
April 17th, 2007, 03:16 AM
|
|
anonymous
|
|
Join Date: Aug 2006
Posts: 244

Time spent in forums: 1 Week 12 h 14 m 42 sec
Reputation Power: 7
|
|
Hi phpscripter here is the JavaScript you always search for:
Javascript Code:
Original
- Javascript Code |
|
|
|
// use dec_sep for internationalization function Decimals(x, dec_sep) { var tmp=new String(); tmp=x; if (tmp.indexOf(dec_sep)>-1) return tmp.length-tmp.indexOf(dec_sep)-1; else return 0; }
If you trying to use Math for this you will discover that, because of numbers representation, you have to deal with some errors in multiplying with 10.
Hope it helps
Last edited by mecanicu : April 17th, 2007 at 03:18 AM.
|