ezyang / htmlpurifier

Standards compliant HTML filter written in PHP
http://htmlpurifier.org
GNU Lesser General Public License v2.1
3.02k stars 323 forks source link

fix: Support for locales using decimal separators other than . (dot) #372

Closed cracksalad closed 1 year ago

cracksalad commented 1 year ago

When using somtehing like setlocale(LC_ALL, 'de_DE'); the function sprintf('%.1f, ...)' will use a comma for decimal separation. The function is_numeric() will output false for strings containing a comma. Thereby I had to replace the decimal separator of the used locale with a dot.

ezyang commented 1 year ago

Can we use number_format instead?

cracksalad commented 1 year ago

Can we use number_format instead?

You are totally right. number_format is a much easier solution. I adjusted it.

github-actions[bot] commented 7 months ago

:tada: This PR is included in version 4.17.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: