Top "Numbers" questions

A number is a mathematical object used to count, measure and label.

How to sort an array of integers correctly

Trying to get the highest and lowest value from an array that I know will contain only integers seems to …

javascript arrays sorting numbers
How to format a floating number to fixed width in Python

How do I format a floating number to a fixed width with the following requirements: Leading zero if n < 1 …

python string numbers number-formatting
Formatting a number with leading zeros in PHP

I have a variable which contains the value 1234567. I would like it to contain exactly 8 digits, i.e. 01234567. Is there …

php numbers format
Allow 2 decimal places in <input type="number">

I have a <input type="number"> and I want to restrict the input of the users to purely …

html numbers
Extract a number from a string (JavaScript)

I have a string in JavaScript like #box2 and I just want the 2 from it. I tried: var thestring = $(this).…

javascript regex string numbers numeric
What's the best way to convert a number to a string in JavaScript?

What's the "best" way to convert a number to a string (in terms of speed advantage, clarity advantage, memory advantage, …

javascript string performance coding-style numbers
Test if number is odd or even

What is the simplest most basic way to find out if a number/variable is odd or even in PHP? …

php variables numbers
How to elegantly check if a number is within a range?

How can I do this elegantly with C# and .NET 3.5/4? For example, a number can be between 1 and 100. I know …

c# numbers int
Check if string contains only digits

I want to check if a string contains only digits. I used this: var isANumber = isNaN(theValue) === false; if (isANumber){ .. } …

javascript numbers digits
Format numbers in JavaScript similar to C#

Is there a simple way to format numbers in JavaScript, similar to the formatting methods available in C# (or VB.…

javascript jquery format numbers