numbers Questions
10
Solved
I want to restrict user input to positive numbers in an html form.
I know you can set min="0", however it is possible to bypass this by manually entering a negative number.
Is there any other w...
19
Solved
I want to get only positive values, is there any way to prevent it using only html
Please don't suggest validation method
37
Solved
I need to show a currency value in the format of 1K of equal to one thousand, or 1.1K, 1.2K, 1.9K etc, if its not an even thousands, otherwise if under a thousand, display normal 500, 100, 250 etc,...
Sandpiper asked 27/2, 2012 at 7:52
35
Solved
I'm writing some code that converts a given number into words, here's what I have got after googling. But I think it's a bit too long for such a simple task.
Two Regular Expressions and two for loo...
Leporide asked 8/2, 2013 at 6:29
2
Solved
How can I replace foobar with foo123bar?
This doesn't work:
>>> re.sub(r'(foo)', r'\1123', 'foobar')
'J3bar'
This works:
>>> re.sub(r'(foo)', r'\1hi', 'foobar')
'foohibar'
Cassidy asked 12/5, 2011 at 21:22
13
Using only swift code I cant figure out how to take "(555) 555-5555" and return only the numeric values and get "5555555555". I need to remove all the parentheses, white spaces, and the dash. The o...
19
My end goal is to validate an input field. The input may be either alphabetic or numeric.
Sufism asked 25/4, 2011 at 11:48
40
Solved
I've had quite a bit of trouble trying to write a function that checks if a string is a number. For a game I am writing I just need to check if a line from the file I am reading is a number or not ...
17
I have seen that some browsers localize the input type="number" notation of numbers.
So now, in fields where my application displays longitude and latitude coordinates, I get stuff like &...
Graces asked 30/5, 2011 at 15:50
16
Solved
I'm trying to get my login form to only validate if only numbers were inputted. I can it to work if the input is only digits, but when i type any characters after a number, it will still validate e...
Tremble asked 23/5, 2012 at 5:5
6
Solved
I have a float number such as x=23392342.1
I would like to convert it to a string with engineering notation (with metric prefix)
http://en.wikipedia.org/wiki/Engineering_notation
http://en.wikipe...
11
Solved
I need to find out if a string is numeric in dart. It needs to return true on any valid number type in dart. So far, my solution is
bool isNumeric(String str) {
try{
var value = double.parse(str...
18
Solved
I have two inputs in binary, and I'm returning the addition result in binary as well.
var addBinary = function(a, b) {
var dec = Number(parseInt(a, 2)) + Number(parseInt(b, 2));
return dec.toSt...
Inflated asked 1/11, 2016 at 1:39
6
Solved
I have the following JavaScript code:
var calculation = $('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somev...
Preordain asked 24/3, 2017 at 5:53
11
Solved
15
Solved
I'm trying to write a function to present thousands and millions into K's and M's
For instance:
1000 = 1k
1100 = 1.1k
15000 = 15k
115000 = 115k
1000000 = 1m
Here is where I got so far:
func for...
10
I am looking for a way to call a javascript number in the body of an html page. This does not have to be long and extravagant just simply work, I just want something like:
<html>
<head>...
Filament asked 29/11, 2016 at 5:32
14
I have an HTML page that is right-to-left. When I don't use any doctype, my numbers are in Arabic/Persian, but when I use strict mode they turn to English.
<!DOCTYPE html PUBLIC "-//W3C//DTD HT...
Transitory asked 12/4, 2011 at 13:27
4
Solved
For example, something like:
div {
margin-left: random(-100, 100);
}
25
Solved
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.234001
Number.toFixed() and Number.toPr...
Chelseychelsie asked 31/8, 2010 at 20:0
52
Solved
I am trying to print an integer in JavaScript with commas as thousands separators. For example, I want to show the number 1234567 as "1,234,567". How would I go about doing this?
Here is ...
Calamite asked 24/5, 2010 at 23:42
9
Why won't my input resize when I change the type to type="number" but it works with type="text"?
EXAMPLE
Email: <input type="text" name="email" size="10"><br/>
number: <input typ...
13
Solved
I would like to ask how I can get the length of digits in an Integer. For example:
$num = 245354;
$numlength = mb_strlen($num);
$numlength should be 6 in this example. Somehow I can't manage it ...
Stelmach asked 10/2, 2015 at 14:12
4
I need to understand the following:
when I type 4e4 in Google Chrome's console it returns 40000.
Can anyone help me to understand what is e in javascript numbers and what is the algorithm working...
Altdorf asked 10/9, 2016 at 7:9
29
Solved
I'm trying to convert numbers into english words, for example 1234 would become: "one thousand two hundred thirty four".
My Tactic goes like this:
Separate the digits to three and put th...
Vickery asked 3/4, 2011 at 13:44
© 2022 - 2025 — McMap. All rights reserved.