Jump to content

Text String To Numbers?


Twango

Recommended Posts

I suppose you're doing the calculation with JavaScript (since you're posting in this forum)?If so,

var fieldValueNum = new Number(fieldValue);

is what you need... assuming fieldValue holds the string value of the form field. With the above, fieldValueNum will contain the numeric value of fieldValue, thanks to the Number() object's constructor.Additionally, you may use the parseFloat() and parseInt() functions to convert a value into a float or an integer respectively.

Link to comment
Share on other sites

thx, how do i become a mod?
And ideally, when you have not asked if you could be a mod. And having that said... you pretty much blew up your chances (at least for the forseeable future) :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...