SSF Number Formatter
As explained in "Number Formats", modern spreadsheet
file formats separate "content" from "presentation". Instead of storing a
formatted value like $3.50
, applications will store the underlying value
(3.50
) and the number format ($0.00
). Parsers are expected to render values.
The SheetJS SSF
("SpreadSheet Format") library formats numbers according
to the number formatting rules defined in Excel and other spreadsheet software1
A version of the library ships with the main file processing library. It is
deeply integrated in SheetJS CE API functions including read
2, write
3,
and sheet_to_json
4.
The library is also available for standalone use on the SheetJS CDN5.
Source code and project documentation are hosted on the SheetJS git server at https://git.sheetjs.com/sheetjs/sheetjs/src/branch/master/packages/ssf
Live Demo
The formatted text is calculated from the specified number format and value. Please report an issue if a particular format is not supported.
- The number formatting rules are sketched in ECMA-376. A rough grammar is defined in the MS-XLS specification.↩
- See
read
in "Reading Files"↩ - See
write
in "Writing Files"↩ - See
sheet_to_json
in "Utilities"↩ - See https://cdn.sheetjs.com/ssf/ for more details.↩