Questions tagged [digit]

Anything related to numerical digits, i.e. the symbols used to write the representation of a number in a number system, such as decimal, hexadecimal, octal or binary systems.

Anything related to numerical digits, i.e. the symbols used to write the representation of a number in a number system, such as decimal, hexadecimal, octal or binary systems.

See Wikipedia page on numerical digits.

375 questions
1
vote
2 answers

input tag never show the face of non-numeric words

In html,I want to make input allow digits only. I know there is a onkey(up|press|down) event,but if you tried then you know that one digit that you pressed first will show its face for a second which would not look beautiful. So how to make it(the…
IsEE
  • 45
  • 6
1
vote
3 answers

Javascript : How to find the position of a zip code in a string?

I've got an address like this : 7 CITE VANEAU - 75007 PARIS. My goal is to get the zip code. The zip code can change for each address, but it's always 6 digits long. I want to find the position of the beginning of the zip code in the string. Do you…
Xavier C.
  • 1,809
  • 4
  • 24
  • 40
1
vote
1 answer

Magento decimal place format from 4 to 2 in soap api cart info

I am getting the cart information using soap api. But in the result, the price show the 4 digit after decimal place, but i want it 2 digit after decimal place. For example, right now it displaying "3.0000" but i want to display "3.00".
1
vote
1 answer

C: Finding closest number to the first without repeating digits from the second number?

I read two numbers, both int. What I need to do is do print the number higher than but closest to the first number, such as 378, but which doesn't contain any of the digits from the second number, for example, 78. Input: 378 78, output: 390 because…
1
vote
1 answer

Which function is faster when you try to get nth digit in a number?

For example you have a number like "11956576835". If you try nth digit from a number like this, you can simply: echo substr("11956576835",3,1); But for the performance is it better to use a math function like this for performance? echo…
Midori Kocak
  • 121
  • 1
  • 7
1
vote
2 answers

Joining a list of string digits to create an integer Python 3

How can I convert this: ['2', '3', '1', '4', '1', '4', '2', '3', '3', '2', '4', '1', '4', '1', '3', '2'] into this 2314142332414132 I've tried using the .join method, but I'm quite new to Python and need some help using it. I've also tried working…
user3870619
  • 55
  • 1
  • 7
1
vote
3 answers

Using matlab,how to find the last two digits of a decimal number?

How can one find the last two digits of a decimal number using MATLAB? Example: 59 for 1.23000659 35 for 56368.35 12 for 548695412
bzak
  • 563
  • 1
  • 8
  • 21
1
vote
3 answers

Seg Fault with isdigit() in C?

I have this code: #include char *tokenHolder[2500]; for(i = 0; tokenHolder[i] != NULL; ++i){ if(isdigit(tokenHolder[i])){ printf("worked"); } Where tokenHolder holds the input of char tokens from user input which have been…
user2757849
  • 227
  • 3
  • 4
  • 14
1
vote
4 answers

How do I separate a 2 digit number into individual digits?

The program prompts the user to enter a 2 digit decimal number. How do I separate the number into two separate variables after the user enters it? Later I need to use the first and the second part of the number so they need to be in different…
user3255422
  • 13
  • 1
  • 3
1
vote
2 answers

How I can handle 1000 digit numbers in Java ?

How to handle 1000 digit number? Anyone can explain it? My code; Long sum = 1L; ... if (String.valueOf(sum).length() == 1000) { ... } But not working, anyone can explain it?
Semih Eker
  • 2,389
  • 1
  • 20
  • 29
1
vote
4 answers

Regular expression to detect exactly "071-XXXXXXX" where X is a digit

im looking for a regex which can be used to detect exactly "071-xxxxxxx" where x is a digit. for an example 0712-954900 matches the scenario.can anyone help me.I tried following code.But it is not working. string phoneNumber = "0712954900"; …
Daryl
  • 339
  • 1
  • 5
  • 17
1
vote
2 answers

Big number in an array - constructor

In Java, I have to make a constructor of an array in which each digit of a big number will be a different char of this array. This is the main class: public static void main(String[] args) { BigNumber bn1 = new BigNumber(1500); BigNumber…
1
vote
5 answers

Char Tester in java (uppercase A-Z,lowercase a-z,digit 0-9,other)

I'm trying to make a program that tells me weather the char i put in arguments is uppercase or lowercase or a digit from 0 to 9 or other! I'm having errors in my code: public class CharsTester { public static void main(String[] args) { …
1
vote
2 answers

Generate Regex Digit Ranges from Sorted List of Digits

Suppose I have some sorted lists of integers and I want to convert them to their respective regex digit ranges, like so: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] => [0-9] [0, 1, 2, 3, 4, 6, 7, 8, 9] => [0-46-9] [0, 1, 3, 4, 5, 8, 9] => [013-589] [0, 2, 4, 6,…
Random Human
  • 946
  • 1
  • 14
  • 31
1
vote
2 answers

Regular Expression for float with maxLenght

I want to build a regular expression for float number with maximum Length 6 and max 2 symbols after dot. I Want to allow any of this values XXXXXXX XXXXX.X XXXX.XX XXX.XX XX.XX X.XX I am trying something like this \d{1,4}\.?\d{0,2}, but in this…
Armen Mkrtchyan
  • 921
  • 1
  • 13
  • 34