Category "numbers"

How can I extract a number from a string in JavaScript?

I have a string in JavaScript (e.g #box2) and I just want the 2 from it. I tried: var thestring = $(this).attr('href'); var thenum = thestring.replace( /(^.+)(\

Create a unique number with javascript time

I need to generate unique id numbers on the fly using javascript. In the past, I've done this by creating a number using time. The number would be made up of t

Postscript: how to convert a integer to string?

In postscript , the cvs *operator* is said to convert a number to a string. How should I use it ? I tried : 100 100 moveto 3.14159 cvs show or 100 100 movet

How can I generate a random number in a certain range?

How can I create an app that generates a random number in Android using Eclipse and then show the result in a TextView field? The random number has to be in a r

Finding the 1500000th Fib Number Using C++

I wrote the following code to find the 1500000th Fibonacci number(Please ignore horrible indenting, I wrote this in about 2 minutes). I need it as a string. Thi

Lazy Catalan Numbers in Haskell

How might I go about efficiently generating an infinite list of Catalan numbers? What I have now works reasonably quickly, but it seems to me that there should

Remove insignificant trailing zeros from a number?

Have I missed a standard API call that removes trailing insignificant zeros from a number? var x = 1.234000; // to become 1.234 var y = 1.234001; // stays 1.234

Convert number to alphabet letter

I want to convert a number to its corresponding alphabet letter. For example: 1 = A 2 = B 3 = C Can this be done in javascript without manually creating the