Skip to content
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

currency formatting does not work #267

Closed
xajhqffl opened this issue Jun 30, 2015 · 6 comments
Closed

currency formatting does not work #267

xajhqffl opened this issue Jun 30, 2015 · 6 comments

Comments

@xajhqffl
Copy link

I have cell configured as below
{v:1222.34, z: '$#,##0'}

And I used the write function to xlsx file.
It does not do any formatting. But it works fine for {v:12.34, z:'0.00%'}, with percentage.

I'm referring the library this way. http://oss.sheetjs.com/js-xlsx/xlsx.core.min.js

@surjikal
Copy link

This is a problem for me as well. Really need this!

@AllenHW
Copy link

AllenHW commented Oct 19, 2015

Agreed! Would really love to see this 👍

@Gargamil
Copy link

+1

@thiagoalvernaz
Copy link

I had this same problem, you can solve with parseFloat
cell.t = 'n';
cell.z = XLSX.SSF._table[4];
cell.v = parseFloat('2054.78');

@SheetJSDev
Copy link
Contributor

There is no need to manually add to the string table anymore. Just assigning the z property to the number format is sufficient -- the writers will automatically build the table for you.

@ConAntonakos
Copy link

ConAntonakos commented Sep 11, 2017

I apologize for the bump and perhaps even tangent, but is it possible to combine the Intl object's properties to dynamically format currency based on locale and currency codes?

I've tried to write to a some of the properties of the cell but to no avail. Thanks!

RimaCiklum pushed a commit to Folcon/js-xlsx that referenced this issue Aug 20, 2020
- updated SSF to 0.9.2
- XLSB style records and number format writing
- CSV avoid parseFloat (fixes SheetJS#646 h/t @jabbermarky)
- CSV recognize mac line ending (fixes SheetJS#648 h/t @charlesread)
- BIFF2 format table refactored to align with SSF
- BIFF5 image data exposure
- SSF custom format auto table update (fixes SheetJS#267 h/t @Fangmingdu)
- eslint more checks
- browser test timeout extended to 10 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants