/oss · 1 merged

borgar/numfmt

A JavaScript library that formats numbers and dates the way spreadsheet number formats do.

the project on GitHub (opens in a new tab)
  1. 10 Nov 2026

    Fraction formats now show the right whole number

    What was broken
    Formatting 2.96 as a sixteenths fraction gave 3 15/16, which reads as almost four, and 1.75 in halves gave 1 2/2.
    What I changed
    The whole number is now taken before rounding, and a fraction that rounds up to one is carried over, matching Excel.
    Why it matters
    Spreadsheet apps built on this library show the same fractions as Excel.

    see the code, #110 (opens in a new tab)

← every project