SRL Archive - OSR Help

M (million) to zeros?


halgboy_tbc

2013-03-20 03:24:41

How can I in a string of numbers and an M ('122M') translate that M to six zeros?

So, how could I make '122M' be 122000000?

I am trying to get text and if that text contains an M then I want to change that string into an integer with the appropriate zeros.

Any help on this?

Le Jingle

2013-03-20 03:28:20

GetAmountBox()

Then just make a small box around the item in question

Rhiot

2013-03-20 10:59:57

You can use a string function to remove the M. Then convert the string '122' to an integer, multiply that by 1000000, and convert it back to a string.

masterBB

2013-03-20 11:10:25

a := '122m';

a := ReplaceRegExpr('M|m', a, '000000', True);
a := ReplaceRegExpr('K|k', a, '000', True);

writeln(a);

halgboy_tbc

2013-03-20 22:02:24

Thanks a lot.

shebee

2013-03-20 22:04:30

GetAmountBox(InvBox(1));