-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Money type #41
Comments
So what exactly do you expect to happen? The OpenXML Spreadsheet format has no Type for money, only numbers. The only thing ine could do is apply one of the pre-defined number formats if instances of Money are detected. I'm also not sure why you are calling |
"The only thing ine could do is apply one of the pre-defined number formats if instances of Money are detected" That would be a good quick win 👍 Is it possible to have a number in the cell, like 200.50 and format it like: 200.50 € ? |
If you are given an instance of Money, you could extract the symbol, and create the right format for the currency. The cell would have a float, like 200.50, but Excel would present it as 200.50 €. Does this sound possible? |
I'd like to avoid coupling xlsxtream to third-party Gems and there are many different ways to format monetary values (leading / trailing symbols, different rounding, thousands separators etc.), so having a one-fits-all format for that doesn't really work. I've done a spike on adding support for custom formatters, but ran out of time and I'm not yet sure of the performance implications due to the additional indirection, so I'm not sure of I'll add it, since performance is a number one goal of this gem. In the meantime the easiest workaround would be to store the amount and currency of the money instance in different columns of the worksheet, which also makes it much easier to work with in Excel. |
Makes sense. Performance is top priority for me too and the reason why I picked this gem. Thanks for your work 👍 |
Hi,
I would like to generate an xlsx file in which one of the columns is a currency type. My objects are Money (https://github.com/RubyMoney/money) instances.
I am currently this:
The excel is generated with a column of type numeric.
I was wondering if you could add support of currency format.
Thanks.
The text was updated successfully, but these errors were encountered: