Rosetta Commatizing numbers

Ivan Kazmenko via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 30 21:47:03 PDT 2017


On Wednesday, 31 May 2017 at 04:31:14 UTC, Ivan Kazmenko wrote:
>
> Now, where is the old version wrong? ...

Actually, it also changes every number in the string, not only 
the first one as required.  Because of that, it also fails the 
"do not touch the exponent" requirement.  Sadly, both are not 
covered by the examples.

The program is perhaps easily fixed by changing replaceAll into 
replaceFirst.  As for adding examples to better check the 
requirements, I don't know Rosettacode's policy for that.



More information about the Digitalmars-d-learn mailing list