Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

currency number format using spreadsheet gem

I 'm using Spreadsheet gem to create excel sheet. how can I apply 'currency' number format to a particular cell ?

like image 417
Rutvij Pandya Avatar asked Apr 02 '12 08:04

Rutvij Pandya


1 Answers

Not tried it out but perhaps the following will point you in the right direction:

nb_format = Spreadsheet::Format.new  :number_format => '$#,###.##'
cell.set_format(0, nb_format)
like image 88
Yule Avatar answered Sep 29 '22 14:09

Yule