actionscript 3 - Using RegEx how do I remove the trailing zeros from a decimal number -
I need to type some regigs which takes a number and draws zero behind any decimal point after I The action is 3. So I would like to write:
var result: string = theStringOfTheNumber.replace ([regex], ""); For example: 3.04000 will be 3.04 0.456000 will be 0.456 etc I have spent some time looking at various regex websites and I thought initially before resolving this resolution. 1-9]) 0 + $
OR
(\. \ D *? [1 0] > Code: var Results: string = theStringOfTheNumber.replace (/ (\. \ D *? [1-9]) 0 + $ / g, " $ 1 ");
Comments
Post a Comment