Thursday, 30 August 2012

Bigdecimal not exporting properly

When i was in need of generating my table's data into a report in excel format, i came across this issue.  I was using Spreadsheet gem for this purpose. The value of a particular cell contained lot of decimal places when i wanted it to be only 2 decimal place. After a lot of search, i found a good solution from rubyspreadsheet forum.


 amount = BigDecimal.new(".510283891298392")  
 sheet[0,4]= ("%7.2f" %amount).to_f         /*Converts the Big decimal to a value with 2 Floating points and write it to the (0,4)th cell */ 


If you want to know more, visit this link.

Friday, 24 August 2012

What happens when you hit a URL in your Browser !!

Hello all,

     In the link provided below you will find an article which would be useful to all. Many of us don't know the process that going behind the Browser when we hit an URL. This article will give some basic knowledge on that process.