Closed pdelre closed 5 years ago
Thanks a lot! Even more for the test, you wrote! I think this is the function we should use other than swapping the locale function https://www.php.net/manual/en/function.number-format.php
I had started with number_format
but there could be a loss of precision due to $decimals
(or extraneous data sent).
number_format(1.11);
number_format(1.11, 0, '.', '');
number_format(1.11, 10, '.', '');
Results in
'1'
'1'
'1.1100000000'
Yep, that's what I was trying right now! Ok! I will double-check it tomorrow and merge it tomorrow morning! (I am not in front of my laptop atm!)
Thanks a lot
@gianarb Is there a future release scheduled? We just ran into this bug again in 1.15.0
released May 2019.
When running under locales with a non-
.
decimal_point
separator, PHP generates a bad line protocol string.For example:
Results in two different lines:
This change adds test coverage for this scenario and resolves the issue by ensuring a
.
decimal_point
separator compatible locale is used at time of string casting.