Commit Graph

5 Commits

Author SHA1 Message Date
ybai08 086ee2c750 Write Integers With a Fraction Format As Excel Does
Fix #3625. With a fraction format, PhpSpreadsheet wrote an integer as
the integer alone, so 1 formatted with `0/0` was `1`. Excel writes
`1/1`: a format with no integer part always shows a fraction. Excel
also shows the fraction when the last numerator placeholder is 0, so 1
formatted with `0 0/0` is `1 0/1`; with a `?` or `#` numerator
placeholder the fraction is left out, as before.

The `#` and `0` placeholders were replaced by `?` before
FractionFormatter saw the format, so the replacement moves into
FractionFormatter, which first notes whether the numerator ends in 0.
2026-10-17 20:21:18 -05:00
Adrien Crivelli ec4098c8fd Strict mode for all tests
While we might never be able to have 100% of our code strict, we can at
the very least do it for all of our tests. This ensures that our tests
are using our API with the types as intended by the test author, and not
silently be cast to what our API requires.
2023-09-07 17:44:56 +08:00
MarkBaker 0ebbb3297d Allow use of # and 0 digit placeholders in fraction masks 2023-02-25 12:48:53 +01:00
MarkBaker a6083e7a64 Additional Unit Tests 2023-02-09 18:03:17 +01:00
MarkBaker c47af2a344 Support for fixed value divisor in fractional Number Format Masks 2023-02-02 12:00:50 +01:00