Top "Numbers" questions

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

Testing whether a value is odd or even

I decided to create simple isEven and isOdd function with a very simple algorithm: function isEven(n) { n = Number(n); …

javascript numbers
jquery how to empty input field

I am in a mobile app and I use an input field in order user submit a number. When I …

jquery input numbers field
Check if a number has a decimal place/is a whole number

I am looking for an easy way in JavaScript to check if a number has a decimal place in it (…

javascript validation numbers integer
Format Float to n decimal places

I need to format a float to "n"decimal places. was trying to BigDecimal, but the return value is not …

java android floating-point numbers format
How do I convert an integer to binary in JavaScript?

I’d like to see integers, positive or negative, in binary. Rather like this question, but for JavaScript.

javascript numbers
How to convert number to words in java

We currently have a crude mechanism to convert numbers to words (e.g. using a few static arrays) and based …

java math numbers jscience
What is the best way to tell if a character is a letter or number in Java without using regexes?

What is the best and/or easiest way to recognize if a string.charAt(index) is an A-z letter or …

java char numbers letter
Is there any way to prevent input type="number" getting negative values?

I want to get only positive values, is there any way to prevent it using only html Please don't suggest …

html input numbers
Long vs Integer, long vs int, what to use and when?

Sometimes I see API's using long or Long or int or Integer, and I can't figure how the decision is …

java types numbers
PHP prepend leading zero before single digit number, on-the-fly

PHP - Is there a quick, on-the-fly method to test for a single character string, then prepend a leading zero? …

php string numbers zero