Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Format (hopefully) 1

Status
Not open for further replies.

Cocheez

Programmer
Jun 6, 2001
56
US
Let me apologize for this simple question. I have done research and could only find a (MS)JScript function that does what I need.

What I need is a JavaScript function that simply formats a string (ie. 12.33333 to 12.33). I know I obviously must be looking in the wrong places. This is what I have (the toPrecision() function is a JScript only function, I think):

<script language=&quot;JavaScript&quot;>
function updateProgress(iCur, iTo){
var fPercentage = (iCur / iTo) * 100;
updateProgress = fPercentage.toPrecision(3);
}
</script>

Thanks in advance.

Matt Ulmer
 
here you are:

var temp,rez

temp=12.3333333
rez=parseInt(temp*100)/100 Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top