Welcome To Snipplr


Everyone's Recent Snippets Tagged number



0 790 posted 13 years ago by dubogii
An example of Karatsuba algorithm for multiplication of n digit numbers.
0 885 posted 13 years ago by josepino
This simple function allows you to find a weeks position in the month based on a given date. For instance I needed to alert the user their date was the "Second Week Of January" during a given month. I may never use it again but it came in very hand...
0 3174 posted 13 years ago by aristoworks
converts numbers to their english style
0 483 posted 13 years ago by god_of_nothing
Full credit for this goes to Deva Raj (@nsdevaraj). This is also a good function for doing a similar thing, http://snipplr.com/view/27954/as3-convert-a-number-to-a-string/
2 1165 posted 13 years ago by adrianparr
I needed to split a decimal number into the integer part and the fraction part and save both of them in different variables
0 1454 posted 13 years ago by bwangila
From the tutorial, Validating Various Input Data in Flash (http://active.tutsplus.com/tutorials/actionscript/validating-various-input-data-in-flash/)
1 1103 posted 13 years ago by Activetuts
This seems to be a bug.. or not.. But explains how to fix it anyway.
0 825 posted 13 years ago by godstroke
Sometimes you need to tween a number (for example from 1-100) and to get the number
1 803 posted 13 years ago by burnandbass
0 708 posted 13 years ago by metoikos
Add this in search.php
0 713 posted 14 years ago by laurentzziu
it parses given string and returns 1st number it encounters ( it will replace comas with dots so floats formatted as 12,345 could be 12.345 ( some countries use that ) ) then u can parse returned value as a number / float / int - do what You need...
0 893 posted 14 years ago by stryju
Will help convert string to number OR get number in a selected string.
0 838 posted 14 years ago by carbonr
<p>This function returns a random number within a range.</p><p>For example:</p><p>// assigns low and high values for range</p><p><code>int rangeLow = 34, rangeHigh = 78;</code></p><p>// computes a random number between 34 and 78</p><p><code>myRandomN...
0 757 posted 14 years ago by dblandin
30 minutes spent on this :)
4 811 posted 14 years ago by TEHEK
0 767 posted 14 years ago by Groove
The player selects a range from 0 to n, remembers a number in this range and then the script asks the player a question trying to guess the number. The PC will always guess the correct number.\r\n\r\nI could have added more varied questions, but the...
0 646 posted 14 years ago by Sverri
A simple PHP application for counting how many views a page gets.
0 719 posted 14 years ago by FelixT
Format number using a comma as a separator
3 932 posted 14 years ago by Tmeister
Simple function to return a decimal value between the minValue and the maxValue.
0 1710 posted 14 years ago by Jamie
Simple function to return a value between the minValue and the maxValue.
0 806 posted 14 years ago by Jamie
Always need one of these on hand. Feed it a minimum number and a maximum number and it returns a random within that range. Super useful.
1 890 posted 14 years ago by IsoJon
This returns a string with a single space after the fifth character. Useful for displaying a UK mobile number which is easy to read.
0 975 posted 14 years ago by adrianparr
0 710 posted 14 years ago by jodm