Welcome To Snipplr


Everyone's Recent Snippets Tagged number



If the item cannot be found then the return value is NaN. This function only returns the index of the first occurence found, so it's not very good if you have multiple occurrences of the same value in the array.
0 3722 posted 16 years ago by adrianparr
this could be expanded to the billions place, but c'mon really people? it's got to call it quits somewhere
1 2042 posted 16 years ago by adkatrit
Will strip off the decimals of a number (price) unless they are necessary.
0 1406 posted 16 years ago by jmiller
// Example usage ... trace(fNumToWord(56345)); // Output ... // Fifty-Six Thousand and Three Hundred and Forty-Five
0 2518 posted 16 years ago by adrianparr
Format a number so it is more humanly readable. It allows for setting the number of decimal places (inc. adding 0000s to the end) and separating thousands with a comma. Example usage: trace(numberFormat(1234.695, 2, true, false)); // Output:...
0 2623 posted 16 years ago by adrianparr
Strips out every character except 0-9
0 1453 posted 16 years ago by jmiller
converts a number "v" to a float number and formats the string it with "d" decimals, used on input type text onblur="parseFloatString(this.value,2);"
0 2057 posted 16 years ago by ginoplusio
The Number objects value determines how often the supplied function is repeated. Inspired by ROR & Python. "Pollutes" Number's prototype.
0 1541 posted 16 years ago by peta
Link Trac revisions and change sets.
0 3957 posted 16 years ago by mushookies
first of all i thank to our Creator and Mr.ImHugo for his Action script which i make the java script from it,its works fine and once again i gives thank him for his snippet
1 1741 posted 16 years ago by sujithfem
Probably not the most elegant solution, but it works. Needed this for a capistrano deploy task which shows the most recent tagged releases in my repository. Very bare bones, and needs tweaking if your versions are not in X.X.X.X format.
1 1816 posted 16 years ago by bananastalktome
1 1970 posted 16 years ago by Shifter
3 1938 posted 16 years ago by Shifter
This code was adapted from a snippet I found somewhere awhile back... can't claim complete credit
1 1982 posted 16 years ago by iloveitaly
Useful for SBApplication scripting bridge.
0 2052 posted 16 years ago by iloveitaly
1 1883 posted 17 years ago by cobra90nj
to use this function send in an ASCII character code (use my getKeyCode function) it will return true if the code corresponds to a printable character (not backspace code - 8, enter code - 13, or "undefined")
0 1281 posted 17 years ago by jlvallelonga
It's important that the newPn var that you pass into the Convert.ToInt64 function is in the xxxxxxxxxx format and that no characters are present.
1 2542 posted 17 years ago by blackf0rk
0 1894 posted 17 years ago by Wardy
Usage: formatDecimals(3.1415926, 3); returns: 3.141. Also adds zeros to end if needed.
0 1288 posted 17 years ago by Mijos
Return just the Apache version number of your server, and operating system, from $_SERVER['SERVER_SOFTWARE'] Example: print ('Apache Version: ' . apacheversion()); will return something along the lines of... "Apache Version: 2.2.10 (Unix...
1 2956 posted 17 years ago by iridium
a set of function useful to check data (functions name in italian but easy to translate).
0 2851 posted 17 years ago by ginoplusio
0 1297 posted 17 years ago by jtkendall
0 1285 posted 17 years ago by jtkendall