Top "Numbers" questions

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

Java - Convert integer to string

Given a number: int number = 1234; Which would be the "best" way to convert this to a string: String stringNumber = "1234"; I …

java string numbers int
Validate decimal numbers in JavaScript - IsNumeric()

What's the cleanest, most effective way to validate decimal numbers in JavaScript? Bonus points for: Clarity. Solution should be clean …

javascript validation numbers
How to print a number with commas as thousands separators in JavaScript

I am trying to print an integer in JavaScript with commas as thousands separators. For example, I want to show …

javascript formatting numbers integer
Show a number to two decimal places

What's the correct way to round a PHP string to two decimal places? $number = "520"; // It's a string from a database $…

php formatting numbers rounding number-formatting
How to extract numbers from a string in Python?

I would extract all the numbers contained in a string. Which is the better suited for the purpose, regular expressions …

python regex string numbers
How can I limit possible inputs in a HTML5 "number" element?

For <input type="number"> element, maxlength is not working. How can I restrict the maxlength for that number …

html input numbers max
How do I check that a number is float or integer?

How to find that a number is float or integer? 1.25 --> float 1 --> integer 0 --> integer 0.25 --&…

javascript types numbers
How to make HTML input tag only accept numerical values?

I need to make sure that a certain <input> field only takes numbers as value. The input is …

html input numbers validating
Java Generate Random Number Between Two Given Values

I would like to know how to generate a random number between two given values. I am able to generate …

java random numbers
Can I hide the HTML5 number input’s spin box?

Is there a consistent way across browsers to hide the new spin boxes that some browsers (such as Chrome) render …

javascript css html input numbers