PhpSpreadsheet
PhpSpreadsheet copied to clipboard
Add format number with thousands separator and no decimal
Add format number with thousands separator and no decimal "#,##0'"
This is:
- [X ] a new feature
Why this change is needed?
Because I can't format a number wihtout decimal places.
Fixes Github #4443
Please add formal unit test(s) to show that your new constant works correctly.
3 months, no update, closing.
I'm not a coder so no idee how to do tests.
Thanks.
Wouldn't it be better if you told me that when I asked instead of just ignoring my request?
Feel free to open a new PR if you wish. Your test should actually be pretty easy. Take a look at tests/data/NumberFormat.php. It has entries like:
[
' $ 1,111.11 ',
'1111.111',
NumberFormat::FORMAT_ACCOUNTING_USD,
],
The second line is the expected result of the formatting, the next line is the value which is to be formatted, and the next line is the format which is to be used. Add an entry to this file using your new constant. Be aware of my comment above that a more descriptive name is needed for the constant.