|
horks Apprentice
Joined: 20 Jul 2001 Posts: 127 Location: USA
|
Posted: Sun Apr 07, 2002 12:16 am
inserting a charater |
how do I add a charater to a var? I need to add it from the right side.
I have a var with a value of "12345". This var is the result of some math triggers I run. "12345" is actually a number with two decimal points in it, and I want to put a decimal back in, to make the value "123.45" ...
the result of my math trigger will always have 2 decimal points, but may only be 4 charaters long (i.e. 1234 should still be 12.34)
Anyone know how to do this? thanks :) |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Apr 07, 2002 12:33 am |
x=%concat(%leftback(@x,2),".",%rightback(2))
or you could do
x=%trim(%format("&10.2f",@x)) |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Apr 07, 2002 3:47 am |
Bear in mind that after you insert the . the variable will no longer be a number.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
|
|