• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

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"
0
894359
Asked:
894359
  • 2
1 Solution
 
objectsCommented:
s = s.substring(0, s.indexOf(".")+3);
0
 
894359Author Commented:
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)%>

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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now