Add support for one digit decimals (FORMAT_NUMBER_0, FORMAT_PERCENTAGE_0) (#2525)
* Add support for one digit decimals (FORMAT_NUMBER_0) * Add support for one digit decimals (FORMAT_NUMBER_0, FORMAT_PERCENTAGE_0) * adding tests for one digit numbers * cleanup * add failing test to block merge of this PR until #2555 has been merged * fix code style * fix test
This commit is contained in:
parent
b5c03fc61f
commit
454c01be51
|
|
@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
|
|||
- Full support of the above CF Rules for the Xlsx Reader and Writer; even when the file being loaded has CF rules listed in the `<extLst><ext><ConditionalFormattings>` element for the worksheet rather than the `<ConditionalFormatting>` element.
|
||||
- Provision of a CellMatcher to identify if rules are matched for a cell, and which matching style will be applied.
|
||||
- Improved documentation and examples, covering all supported CF rule types.
|
||||
- Add support for one digit decimals (FORMAT_NUMBER_0, FORMAT_PERCENTAGE_0)
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,13 @@ class NumberFormat extends Supervisor
|
|||
const FORMAT_TEXT = '@';
|
||||
|
||||
const FORMAT_NUMBER = '0';
|
||||
const FORMAT_NUMBER_0 = '0.0';
|
||||
const FORMAT_NUMBER_00 = '0.00';
|
||||
const FORMAT_NUMBER_COMMA_SEPARATED1 = '#,##0.00';
|
||||
const FORMAT_NUMBER_COMMA_SEPARATED2 = '#,##0.00_-';
|
||||
|
||||
const FORMAT_PERCENTAGE = '0%';
|
||||
const FORMAT_PERCENTAGE_0 = '0.0%';
|
||||
const FORMAT_PERCENTAGE_00 = '0.00%';
|
||||
|
||||
const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd';
|
||||
|
|
|
|||
|
|
@ -591,6 +591,61 @@ return [
|
|||
'1.9',
|
||||
NumberFormat::FORMAT_NUMBER,
|
||||
],
|
||||
[
|
||||
'1.0',
|
||||
'1.000',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'-1.0',
|
||||
'-1.000',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'1.0',
|
||||
'1',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'-1.0',
|
||||
'-1',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'1.0',
|
||||
'1',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'0.0',
|
||||
'0',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'0.0',
|
||||
'-0',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'1.1',
|
||||
'1.11',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'1.1',
|
||||
'1.14',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'1.2',
|
||||
'1.15',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'1.2',
|
||||
'1.19',
|
||||
NumberFormat::FORMAT_NUMBER_0,
|
||||
],
|
||||
[
|
||||
'0.00',
|
||||
'0',
|
||||
|
|
@ -831,6 +886,66 @@ return [
|
|||
'-0.019',
|
||||
NumberFormat::FORMAT_PERCENTAGE,
|
||||
],
|
||||
[
|
||||
'0.0%',
|
||||
'0',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'1.0%',
|
||||
'0.01',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'1.1%',
|
||||
'0.011',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'1.1%',
|
||||
'0.0114',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'1.2%',
|
||||
'0.0115',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'1.2%',
|
||||
'0.0119',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'0.0%',
|
||||
'-0',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'-1.0%',
|
||||
'-0.01',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'-1.1%',
|
||||
'-0.011',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'-1.1%',
|
||||
'-0.0114',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'-1.2%',
|
||||
'-0.0115',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'-1.2%',
|
||||
'-0.0119',
|
||||
NumberFormat::FORMAT_PERCENTAGE_0,
|
||||
],
|
||||
[
|
||||
'0.00%',
|
||||
'0',
|
||||
|
|
|
|||
Loading…
Reference in New Issue