Link to home
Start Free TrialLog in
Avatar of MJ
MJFlag for United States of America

asked on

Concat a string at certain character

If I have a string for example "000000.0000" or
"abc.def"

How would I pull any thing off two spots past the decimal

So the rersults would return

 "000000.00" or
"abc.de"
Avatar of Mick Barry
Mick Barry
Flag of Australia image

s = s.substring(0, s.indexOf(".")+3);
Avatar of MJ

ASKER

Is it possible to do something like this?
Take the below:

<%=getStatBookValue(keyname)%>

and do something like this:

<%=getStatBookValue(keyname).substring(0, s.indexOf(".")+3)%>

ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial