Closed ickbinhier closed 6 years ago
Hi,
this not use case for Float::fromString()
. You must write own parser. If you remove currency symbol, then you use Float::fromString()
I understand that.
But so far I've thought that the purpose of this class is to take a string and extract the float from it, no matter what the user types.The € and $ were just examples.
Have I been wrong and you see another sense in the class?
Am 22.04.2018 um 20:45 schrieb Milan Matějček:
Hi, this not use case for |Float::fromString()|. You must write own parser. If you remove currency symbol, then you use |Float::fromString()|
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/h4kuna/data-type/issues/6#issuecomment-383403267, or mute the thread https://github.com/notifications/unsubscribe-auth/ACrkGFTjsdqHOHN-3PPR60n5fOPmcITNks5trM_mgaJpZM4TeUfI.
-- Andreas Lemke Anwendungsentwickler, Administrator und IT-Koordinator
eMail: andreas.lemke@tu-braunschweig.de Tel: +49 531 391-7296 Fax: +49 531 391-8228
Anschrift: TU Braunschweig Sprachenzentrum Bültenweg 74 38106 Braunschweig
Hi, it is only reverse function for number_format
And that is different with the Ints class?
Am 23.04.2018 um 11:35 schrieb Milan Matějček:
Hi, it is only reverse function for number_format http://php.net/manual/en/function.number-format.php
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/h4kuna/data-type/issues/6#issuecomment-383514738, or mute the thread https://github.com/notifications/unsubscribe-auth/ACrkGIrb8IbN-qnE3rfpRsB7oFvX1A0Jks5traBJgaJpZM4TeUfI.
-- Andreas Lemke Anwendungsentwickler, Administrator und IT-Koordinator
eMail: andreas.lemke@tu-braunschweig.de Tel: +49 531 391-7296 Fax: +49 531 391-8228
Anschrift: TU Braunschweig Sprachenzentrum Bültenweg 74 38106 Braunschweig
Find int is easier then float where is delimiter like comma or dot.
Int::fromString is little bit dangerous becasue
Foo 64, bar 63
// result is int 6463
Hello,
I have a problem.
Float :: fromString ('1,40 €'); and Float :: fromString ('$ 1.40'); make a mistake.
I have created a Pull Request. Can You please check this.
https://github.com/h4kuna/data-type/pull/5