[Javascript] type casting...

J.R. Pitts listuser at wjponline.com
Fri Jun 27 22:34:14 CDT 2003

I don't usually do javascript, but every now and then....

I am doing some time math. I use the following statement to convert a time
string (ie...15:30) to a total number of minutes (ie..930)

 endMinutes=endTime.substring(0,2)*60 + endTime.substring(3,5)*1

I have to use the ending "*1" to cast the the ending string to a number, so
that I get '930' instead of a string concatenation (90030)

Works fine, but what is the proper javascript way to do this?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20030627/a1d440d1/attachment.htm>

More information about the Javascript mailing list