currency formatting does not work #267

Closed
opened 2015-06-30 16:08:24 +00:00 by Fangmingdu · 6 comments
Fangmingdu commented 2015-06-30 16:08:24 +00:00 (Migrated from github.com)

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

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 commented 2015-07-27 22:20:15 +00:00 (Migrated from github.com)

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

This is a problem for me as well. Really need this!
AllenHW commented 2015-10-19 15:27:18 +00:00 (Migrated from github.com)

Agreed! Would really love to see this 👍

Agreed! Would really love to see this :+1:
Gargamil commented 2015-11-18 13:46:56 +00:00 (Migrated from github.com)

+1

+1
thiagoalvernaz commented 2016-03-04 16:51:01 +00:00 (Migrated from github.com)

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

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 commented 2017-05-11 23:54:10 +00:00 (Migrated from github.com)

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.

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 commented 2017-09-11 21:02:06 +00:00 (Migrated from github.com)

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!

I apologize for the bump and perhaps even tangent, but is it possible to combine the [Intl](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/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!
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#267
No description provided.