Questions tagged [digits]

Questions dealing with getting, manipulating, or changing the digits of numbers

Filter by
Sorted by
Tagged with
0 votes
2 answers
24 views

How to convert number to zero padding format in vsc?

I'm using vsc and I want to convert any number found to fixed 4 digits length using zero padding . For example : 2 -> 0002 99 -> 0099 Can I use find and replace ? or any extension ? Thanks
andio's user avatar
  • 1,652
0 votes
5 answers
149 views

Are digits only numbers?

According to my research, a digit is a numerical character. But I'm not sure if it can also be a question mark, a comma and even a dot for example. Could someone please confirm if I am right?
user22869055's user avatar
1 vote
1 answer
44 views

python csv writes too many decimals

A well discussed problem, but could not find a suitable answer. writing a float list of points (n,3) of 3D vectors to a file using code: ... with open(filename,"w") as f: csvw=csv.writer(...
peets's user avatar
  • 413
0 votes
1 answer
45 views

Is there a better way to calculate Chilean RUT verification digit?

For those who doesn't know, Chilean RUT is an ID for residents, similar to USCIS#, and is composed by 7-8 numbers followed by a verification digit (calculated by a type of MOD11 check). I made the ...
NiKiuS's user avatar
  • 1
0 votes
1 answer
55 views

Finding the word with the maximum sum of even decimal digits

This x86 assembly code defines two procedures: "addev" to compute the sum of even digits in a word and "maxArray" to find the word with the maximum sum of even digits in an array. ...
P.I.S's user avatar
  • 11
4 votes
9 answers
200 views

How to sum digits of a number untill there is one

I want to solve this but I have no idea how to I´d appreciate your help given n take the sum of the digits of n if that value has more than one digit continue until there´s only one Expected output: ...
Ariky Hito's user avatar
0 votes
1 answer
47 views

word field calculation working with . as decimal separator, but not with , as separator

In word, I have 3 bookmarks where I can insert a number, and then a field that - when updated - calculates another value from these numbers. The formula I use is this one. =X * Y * Z * 0.52*0.001 ...
Spitzi's user avatar
  • 1
0 votes
2 answers
53 views

Preventing Decimal Places in Specific Rows in R Data Frame

I'm working with an R data frame where I have columns representing "year" and "sales". I want to display these values as whole numbers without any decimal places. Currently, when I ...
estrix's user avatar
  • 15
2 votes
3 answers
134 views

Rotate digits of an integer

I am attempting to come up with a generic function that will rotate the digits of a given number to the left or the right by n. At this point I've only been able to work out an implementation for left ...
Kittoes0124's user avatar
  • 4,940
0 votes
1 answer
22 views

using geom_text to create data labels for bar chart

I am practicing with the "diamonds" dataset in ggplot 2. I am trying to make a bar chart plot, to demonstrate the average price per color category: This is the code I wrote: ggplot(data=...
Kiki Liu's user avatar
0 votes
0 answers
44 views

Getting the number of digits in hex number without removing the leading zeros in python

I want to calculate the number of digits in hex number in python for example: num = 0X0101 num1 = 0X00001 print(len(format(num, "04x"))) the problem is the number of digits and the leading ...
Osama Hijazi's user avatar
0 votes
0 answers
40 views

With python 3, what is the fattest way to find biggest digit in a string?

I am working with SMILES, a string representation of molecules, which uses matching pairs of digits to represents rings. I am working with a relatively large dataset, 1,9 Millions strings, for which i ...
Etienne Reboul's user avatar
0 votes
1 answer
55 views

Checking four-digits entries in a column by postgresql

I have a table of user data in postgesql. And I have a certain knowledge of using four-digits combinations in the email address field by the spammers. For example, "[email protected]&...
Dim Ch's user avatar
  • 3
1 vote
1 answer
68 views

Exponential limits for C and Matlab

In computers, the math operation of floating numbers is actually processed using the base number and the exponential number separately, and then combine them together. We learn this in our computation ...
Leo's user avatar
  • 27
1 vote
0 answers
92 views

HIGH LEVEL ASSEMBLY(HLA)PROGRAM:

Create an HLA Assembly language program that calculates the cost of an order at a local fast food restaurant from its dollar value menu of items.. The cost will be based on a single 16-bit value ...
Kayla's user avatar
  • 11
0 votes
0 answers
45 views

How can I use putchar to print numbers from 0 to 20 (or more)?

am looking on how to print digits for 0 to 20 and more with puchar i tried using putchar('0' + 48) is just printing from 0 to 9, finding it hard to do that is there any help please, i have also tried ...
ben_code's user avatar
0 votes
0 answers
7 views

Problem related to the QTableWidget() of the PyQt5 library

I created new QTableWidget() widget and it has some elements and during execution new ones will be created. And i am going to limit users to enter only digits. How can i do it? If you need full code ...
Ismoilmirzo Inoyatov's user avatar
-1 votes
2 answers
49 views

Notepad++ regex - find or remove specific numbers

I would like to remove specific numbers from a text file, the list of the numbers are in order from 1 to 192061. I need to remove a group of numbers, some exemples : "61186","95492"...
zick's user avatar
  • 39
-1 votes
1 answer
66 views

how to generate a random 4 digit alphanumeric number in javascript that corresponds to a passed 8 digit number in a function [closed]

For example if I pass any 8 digit number say 97895614 then it should return some 4 digit number (it can be alphanumeric) in a way that it corresponds only to that passed 8 digit number. I made a ...
user21725186's user avatar
-1 votes
1 answer
128 views

sum of factorials of digits

I want to find 3digit number that the sum of the factorials of it's digits is the same as that number. What is the problem in my codes since nothing shows. Test function gives each digit and fact ...
Andy James's user avatar
1 vote
3 answers
229 views

How to display more decimals in estimates from lmer() function in R-package lmerTest?

I want to test fixed and random effects with the lmerTest R-package. After defining the model with lmer(), I use summary() to get the results. For my results report, I would like to display more ...
LillyZoe's user avatar
0 votes
1 answer
52 views

CSS code to modify reading from english digits to danish digits

In a software i have a CSS code that should create color formatting in a spreadsheet (the spreadsheet is included in a html report created from the software). I have the needed CSS code which works ...
Jacob's user avatar
  • 1
0 votes
1 answer
307 views

LAB: Count the digits. How did I do?

Here is my code that I worked on and wondering how well did I do to simplify this? I just wanted to do my best to get a better understanding of Java. import java.util.Scanner; public class LabProgram ...
whomgodgiveth's user avatar
1 vote
1 answer
95 views

get odd and even part of number using jquery [closed]

i have a 13 digit number and want extract odd and even part of this digit. i want to write truth checker function for EAN-13 barcode type that need calculate numbers of my digit. so i have an digi ...
Ebad ghafoory's user avatar
0 votes
0 answers
37 views

What will be the procedure to detect only red colored handwritten digit?

How to detect only red colored handwritten digit by training a cnn model on MNIST dataset? The model will only detect red colored digit from multiple colored digit. What will be the procedure? I have ...
leon professional's user avatar
0 votes
0 answers
18 views

Program that extracts a vector of numbers with even sum of digits and other with uneven sum of digits from the initial vector

This is the text of the program that I need to write: Write a function "ExtractElements" with two parameters, the first of which is a vector of integers (type "int"), and the ...
ginasi's user avatar
  • 1
1 vote
1 answer
37 views

count the number of class names to 3 digits via a for-loop(001~100) in SCSS(SASS)

How can I compile $i to '3 digit number'? @for $i from 1 through 100 { .bg-image#{$i} { background-image: url("folder/bg-image#{$i}.jpg"); } } I want it to compile like this. .bg-...
Syoki's user avatar
  • 46
0 votes
0 answers
34 views

how to distinguish same digits but they are in different location in a string [duplicate]

There is a string composed with two underscores, respectively the first and third digit.I'd like to replace each underscores as 1-9, and then generate a list. I want to use two loop, the firt loop is ...
Lorraine's user avatar
0 votes
0 answers
8 views

mysql: How to write the select condition clause to retrieve records with any matching digits

I want to retrieve all records if one of more digits in codes column matches at least one digit in the query number I pass in. Example table and expected results are provided at the bottom. Example ...
toby's user avatar
  • 31
0 votes
1 answer
46 views

generalize a function in Word Macro

I need to run "LTRrun" command to all digits through documents, I recorded macro while I apply this command manually some times then I run this macro multi times till end of document I work ...
Hisham's user avatar
  • 1
1 vote
3 answers
280 views

Converting a digit from char to integer in C language [duplicate]

I'm reading the C programming textbook1 and in 1.6 they're saying the conversion between a char containing a digit and an int can be done like this: char character = '7'; int integerChar = character - ...
user avatar
3 votes
4 answers
116 views

vectorised function to calculate sum of digits

I have a vector of numbers (eg. c(1, 11, 1232, 4221, 2)), and I need a corresponding vector of the sums of digit of each element (c(1, 2, 8, 9, 2), in the previous example). I found some nice ...
BoTz's user avatar
  • 479
1 vote
2 answers
58 views

How to add hypens between specific numbers and characters?

This is my data set and I want to put hyphens between specific digits and characters. df_t 1 2 3 4 5 6 row_names X2012SGA007930001 1 2 3 4 5 6 X2012SGA007930001 ...
user avatar
-1 votes
1 answer
142 views

Get last two digits SQL

I Need to find a solution to get the last two digits of a value in the column. Im using informix sql and the values in the column are always only numbers but in various lenghts. Thanks for any advice! ...
tacosoos's user avatar
0 votes
2 answers
325 views

Get number of digits in a base10 integer

It bugged me that std::to_string doesn't allow for custom allocators, so I'm writing my own implementation. For this it would be beneficial to know beforehand how many digits I need to allocate string ...
glades's user avatar
  • 3,925
0 votes
3 answers
77 views

Why does it tell me its an Armstrong number when I enter strings?

This is the code for finding an Armstrong number of 3 digits. But when i enter strings or any other special character it categorizes it as an armstrong number while it should be other way around. #...
Harshil Zahran's user avatar
1 vote
1 answer
520 views

What is the fastest way to sum two strings made up of only numbers but without converting each to an int beforehand?

If I am given two strings made up of only numbers 0-9, what is the fastest way to sum the two? Doing something like str(int(num1) + int(num2)) is not allowed and fails. It mentions in a failed test ...
JeffSpicoli's user avatar
0 votes
0 answers
90 views

OCD digit recognition on a LCD display

I'm tring to get the digit from this LCD display: LCD Display I used pytesseract whit this code: img = cv2.imread('1.png') img = get_grayscale(img) img = cv2.bitwise_not(img) custom_config = r'--psm ...
Giulia Meo's user avatar
-3 votes
1 answer
690 views

if the character is a numeric digit, prints its name in text (e.g., if input is 9, output is NINE) [closed]

enter image description here in the image please see the option c . I need a program in python. enter image description here I was trying to print number in word but I didn't get successful. I want a ...
Anand's user avatar
  • 7
-1 votes
3 answers
118 views

Using for loop to find minimal sum of digits in given number interval

So, I am doing a task that asks to find the amount of positive integers from interval [m, n] with minimum sum of digits. I declared a function that computes the sum of digits, however I am having ...
lavinlyv's user avatar
0 votes
1 answer
142 views

C++: How to Generate All Combinations of a Vector of Digits of Length N, disregarding order?

So I need to combine a specific number (not string) of digits from a vector of possible ones (all 0-9, not characters) in an N-digit number (not binary, then). However, I cannot have any extra ...
Hudson's user avatar
  • 338
0 votes
0 answers
67 views

optim function: how to restrict number of decimal places?

I am using the optim function in R to analyze how people percieve distributions. My usual code looks like this: val.FR<-optim(par=0, fn=Frequency.Regression, method=c("Brent"), lower = ...
Jonas's user avatar
  • 1
-3 votes
4 answers
233 views

T-SQL how to add trailing zeros to a string varchar [closed]

My number needs to be 8 digits long, however If its less than 8 digits long I need to add trailing zeros to the it. Example: 1234 Desired result: 12340000 I tried this at first: DECLARE @YourNumber ...
Rafa N's user avatar
  • 1
1 vote
1 answer
37 views

Chance number of digits on the x-axis

I try to plot price agains year. year is formated as integer, but is ploted with one digit. How can I change that? x-axis without digit. df looks like this: now I use this code to plot: ggplot(df, ...
Alex Auf der Maur's user avatar
2 votes
3 answers
71 views

Separating numbers using %

I am trying to get 3 numbers separated by a space after user's input. I can get the first number and the last one dividing by 10, but I really have no idea how to get the middle number I tried to take ...
Chernosmaga's user avatar
0 votes
0 answers
11 views

What does 'static Strings arr[]' means in java?

I am trying to convert 2019 into "two zero one nine" with the help of recursion in java. enter code herestatic String digits[]={"zero","one","two","three&...
Piyush Yadav's user avatar
1 vote
1 answer
65 views

How to print each digit of the number different from the one that precedes it?

For example, if I have the number 35565, the output is 3565. So, my snippet gets single digits, but I don't know how to keep previous digit to check it with the next one. for { num = num / 10 fmt....
the noob coder's user avatar
0 votes
1 answer
254 views

Function 'findSmallerDigits' should return an array of numbers of smaller digits JavaScript

Write a countNextSmaller function that accepts an array of numbers and returns a new array of numbers, the i-th element of which must be the number of numbers to the right of numbers[i] that are ...
m.strilec's user avatar
0 votes
0 answers
137 views

pytesseract has bad performance on digits

I have the following image which I want to parse to '4/1/3' with pytesseract. The result I get is '4/13\n'. When using a grayscale image, the performance is slightly better from experience. For this ...
Moritz Groß's user avatar
  • 1,354
-3 votes
3 answers
359 views

Breaking down a number into digits - C

I'm trying to create a program that breaks down a number into its component digits. The code I've written so far is as follows: #include <stdio.h> int main() { int num; int digits; int count = ...
user avatar

1
2 3 4 5
22