Coder-Spirit / php-bignumbers

A robust library to handle immutable big numbers inside PHP applications
MIT License
131 stars 29 forks source link

fromFloat: Ensure dot as decimal point. #74

Open apapsch opened 4 years ago

apapsch commented 4 years ago

String conversion is locale aware, because its primary use case is for display purposes. This hack assumes that the only other decimal point is a comma, which gets replaced by dot.

Alternatively, locale could be set to C before conversion and restored after conversion, although this might incur an performance penalty, because setlocale does I/O.