Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepending zero on negative percentage numbers -10<n<-9 #3920

Closed
2 of 11 tasks
nicholasruunu opened this issue Feb 27, 2024 · 0 comments · Fixed by #3921
Closed
2 of 11 tasks

Prepending zero on negative percentage numbers -10<n<-9 #3920

nicholasruunu opened this issue Feb 27, 2024 · 0 comments · Fixed by #3921

Comments

@nicholasruunu
Copy link
Contributor

nicholasruunu commented Feb 27, 2024

This is:

What is the expected behavior?

-9.0%, -9.1%, -9.2%, -9.3%, -9.4%, -9.6%, -9.6%, -9.7%, -9.8%, -9.9%, -1.0%

What is the current behavior?

-9.0%, -09.1%, -09.2%, -09.3%, -09.4%, -09.6%, -09.6%, -09.7%, -09.8%, -09.9%, -1.0%

What are the steps to reproduce?

<?php

require __DIR__ . '/vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\Style\NumberFormat\Formatter;

foreach (range(-0.090, -0.100, 0.001) as $value) {
    echo Formatter::toFormattedString($value, '0.0%') . PHP_EOL;
}

What features do you think are causing the issue

  • Reader
  • Writer
  • Styles
  • Data Validations
  • Formula Calculations
  • Charts
  • AutoFilter
  • Form Elements

Which versions of PhpSpreadsheet and PHP are affected?

Tried 1.29 and 2.0.0

@nicholasruunu nicholasruunu changed the title Prepending zero on negative percentage numbers -1.0<n<-0.9 Prepending zero on negative percentage numbers -10<n<-9 Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant