implement support to change format of a cell
Hi.
Great gem! I just used it on a small project I'm working on. Thanks!
I'd like to suggest to implement a method on Cell class to allow to change a format the cell after it has been created.
Something like this:
cell = worksheet.add_cell(0, 0, "100") # created using string format
cell.change_format(:number) #force change to number
I could try to work on this code. Would you be interested in pull request with this feature ?
The problem here is coming up with the API. You do realize that there's a wide variety of possible number and date/time formats, right? (And those listed are only a pre-selected fraction of what is possible at all).
Thanks for replying. I think this fraction of possible formats should be good for start.
Maybe you could have methods to change it to the primitive formats:
- General
- Number
- Currency
- Date
- Time
- Percentage
- Text
why not. May be better to replace "General" with "Raw"
Maybe even better. Make something just like when you paste something to excel that it doesn't ask you, it "magically" guess the format. Would be nice to have something similar. I stumble upon a problem to generate a table with several different kinds, but all strings on Ruby and I'm struggling to identify and format percentage numbers.