441 questions
5
votes
2
answers
131
views
Update MySQL database column to round all values to 2 decimal places
I have a MySQL database of some 5000 products imported from Excel a while ago. Unfortunately, Excel truncates values with trailing zeroes so they were imported into the Price column in a mix of values ...
0
votes
1
answer
38
views
Preventing pandoc from adding a space after comma used as a decimal separator in math mode
I am using pandoc to convert markdown files containing TeX bits to html.
Because the text is in Italian, I want to use comma as a decimal separator. However, pandoc keeps adding a space after the ...
0
votes
1
answer
121
views
Can't enter decimal point in textbox bound to a float
I am using Dot Net 8.0 and I have created a WPF application. On a window I wish to have a textbox control that is bound to a Float so the user can see and modify it.
I have tried many things but ...
1
vote
2
answers
77
views
Put decimal separator after the first two digits in R
I have downloaded a table of temperature data from a datalogger where the decimal points dissapeared. Here is a fragment:
temperature<-c( 227725, 208957, 210834, 214588, 218342)
date<-c("...
0
votes
0
answers
98
views
The fastest way to split uint64 into two others by digit position
I have a function like:
func splitNumberByDecimals(u uint256, dec uint) (intFraction, decFraction uint){
...
}
The task is to extract an unsigned number, and the number of decimal places for this ...
0
votes
1
answer
766
views
Formula for Column to Keep a Running Balance of Transactions is Producing Additional Decimal Places
*Update: Solved
I've learned that it's not really a problem other than to annoy me. See additional blockquote notes for more info. If it still bugs you, I posted a solution.
Original Question:
I ...
1
vote
1
answer
686
views
Postgres how to insert reals with decimal comma?
My database is a postgres v14 database with en_US UTF-8 locale. I have to import many .csv files and they have usually a decimal point (3.14) for reals and sometimes a decimal comma (3,14). My ...
0
votes
1
answer
97
views
R+arrow: reading double with comma decimal separator
Please have a look at the code at the end of the post.
You can download the input tsv file (nothing malicious!) from
https://e.pcloud.link/publink/show?code=XZ5eCWZdrwFuo5POSVzi7ywCmteHfE4rdmV
I am ...
0
votes
1
answer
2k
views
How to check the number of decimal places in STRING number?
If I have a value, could be a type P or a string, i.e. 12.345, I want to know if the decimal places is more than two.
I cannot seem to find a conclusive way of doing this in ABAP from my research. ...
1
vote
0
answers
176
views
CS50 Week 1 "Half" practice problem is producing unexpected results. What is going wrong here?
I am currently working on the "Half" practice problem in CS50. I am struggling to get the program to output the correct decimal values. First of all, this is my current solution at the ...
0
votes
1
answer
160
views
Preserve decimal places in DataFrame
I'm trying to read the excel worksheet to DataFrame using pd.read_excel() function. I want to check if each element in the FX column contains 2 decimals and are displayed with 2 decimals. Actually all ...
1
vote
1
answer
62
views
I am having an issue correctly appending decimal pointers in my small Basic Calculator App
In my basic calculator app, I'm experiencing a problem with correctly appending decimal points. When I input a number like 2.5 and then try to perform a calculation, the decimal point disappears, ...
1
vote
2
answers
1k
views
Java set locale permanently
I am completely new to Java (I am mainly using Python) and I am using it on a Windows machine with the IntelliJIDEA IDE. When entering a decimal using the dot (".") instead of the comma (&...
0
votes
1
answer
134
views
Django normalize() is showing 1E+1
I'm trying to create a function in my model to display product info, and in my model I have the following:
class Product(models.Model):
price = models.DecimalField(max_digits=10, decimal_places=2)
...
-1
votes
1
answer
2k
views
Scientific notation in c
How can I print the output as 123.4e+04 by increasing the number of digits before the comma instead of 1.234e+06 when using scientific notation in c
I tried the %*.*e representations, as shown below, ...
-2
votes
2
answers
294
views
How to set consistent decimal separators in R data frame? [duplicate]
Some columns in my data frame have ',' and some have '.' as decimal separator.
DateTime a b c
2000-01-01 00:30:00 3,4 6,1 9.5
2000-01-01 00:45:00 3,5 6,8 7.4
I would like to ...
1
vote
1
answer
152
views
transform int to decimal number by Angular
Hello I tried to transform the price int to decimal number.
for exemple : 900 -> 9,00 or 950 -> 9,50
I tried diverse number like I saw in this platforme but it always shows 900 or 900,00. not 9,...
0
votes
1
answer
33
views
Kotlin how to make 123.456 format
I have scales application. I want to display i.e. 123.456g
I have uint8 that represents 123 (scales range is 0 - 150g)
I also have uint16 that represents 456 (scales range .0 - .999g)
My code:
val ...
0
votes
0
answers
35
views
Maintain decimal points with 0 in JSON object [duplicate]
My requirement is to maintain the decimal value with 0. Here I have mentioned the sample object below.
let sampleObject = {
"firstname": "Sundar",
"lastname": &...
1
vote
0
answers
138
views
Change decimal comma to point without losing formating
I want to import a .csv file and switch the decimal comma to a point. Depending on the format I use to separate columns in the .csv file, can the program not read the file though, or if I change the ...
0
votes
1
answer
29
views
Converting\ joining a list into a float
by scraping a website I managed to get what i wanted, '2' '.' '7' '8'
I've put them in a list.
Now i want them all to be joined as a float 2.78
Can someone suggest something?
Thank You
I cannot join ...
0
votes
2
answers
161
views
Can I change value's decimal point seperately in pandas?
I want each values of df have different decimal point like this
year month day
count 1234 5678 9101
mean 12.12 34.34 2.3456
std 12.12 3.456 7.789
I searched to find a ...
0
votes
2
answers
227
views
I want my value modified to always have three decimal digits
My logic calculates and returns a value based on user input, I want to modify that value to always have three decimal digits
For example;
1 to 1.000
1.02 to 1.020
2.000004 to 2.000
2.5687 to 2.569
How ...
0
votes
1
answer
125
views
In ggscatter in R, can I use "," instead the "." on the r and p-value?
I am using ggscatter for a correlation graphic. It works, with de Pearson correlation (r) correct. However, I am Brazilian, and the decimal point is defined by the "," instead of the ".&...
1
vote
2
answers
1k
views
How to perform precission deviding in Golang equal to BigDecimal.devide(BigDecimal divisor, MathContext mc) in java
I've a task to migrate core banking system from java to golang, but I get stuck when I try to perform precision division in golang. I've try with math/ package rounding function but I don't get my ...
1
vote
1
answer
394
views
RMarkdown mid-line Decimal Place for Lancet
I'm writing an article for a Lancet Journal, which infuriatingly require the decimal place to be a placed mid-line (ie, 23·4, not 23.4). I typically write my articles in RMarkdown for reproducibility ...
2
votes
1
answer
316
views
How can I differentiate decimal comma and decimal point on my js calculator?
Like I've written in the title I would like to differentiate this 2 kinds of decimal in my js calculator because they mean two different things. I tryed to read around and I found something about ....
0
votes
1
answer
581
views
maximum function in R removes decimals
I have a question according to the max function in R. I have a column in a dataframe which has 2 decimals after the comma and whenever I apply the max function on the column i will get the highest ...
2
votes
1
answer
3k
views
How to declare Decimal place in RPGLE Fixed or in free format?
I don't have much knowledge in RPGLE. I am trying to solve this small exercise given to me. I never worked or seen exercises using decimals. I want to get percentage of 7 values. So, I want to do the ...
0
votes
1
answer
229
views
Is there a way to let excel recognize decimal placement?
I've written a csv file with the .to_csv function. This worked fine but when I open the csv file in excel, excel doesn't recognise the decimal placement.
For example:
A number that was supposed to be ...
-2
votes
2
answers
2k
views
How do I parse a decimal number from a string to an integer in C#?
I want to convert a decimal string to an integer but I keep getting the following error:
System.FormatException: Input string was not in a correct format.
var myString = "18.7";
var ...
0
votes
2
answers
439
views
Formatting variable of type double when declaring it
I'm aware of the many ways of formatting a double variable to X # of decimal places. With that being said:
static double currentSelectedPrice = 0.00; //format to 2 decimal places
static double ...
0
votes
0
answers
51
views
Strange result in deducting from a Decimal number Truncated or Floored version of the same
Upon trying in simple Console App, with a code like the following, the result found to be quite something unexpected as per the clip following in the end.
Code Used
double A = 1234567.8991;
Console....
-2
votes
2
answers
1k
views
Android Java Decimal Format - Zero is hidden after decimal point
In my app, i want to be able to format numbers to string (with commas) in a TextView e.g 123456.000 to 123,456.000. But the problem is when i type zero (0) as the last number after the decimal point, ...
1
vote
1
answer
224
views
Can not get a precision of a floating number even with Decimal or mpf in Python
I need to display a number, let's say 0.9 exact at least until 17 decimal places. Even if I use Decimal or mpf, it gives me the result as if I would not be using them at all.
from mpmath import mpf
...
3
votes
0
answers
1k
views
Change IXLCell number format from decimal point (.) to decimal comma (,) - c#
So it's pretty simple..(at least I thought so...)
I'm trying to export some data to excel from my app and I can't find a solution how to change decimal point to decimal comma (this is also an European ...
1
vote
1
answer
4k
views
Specify comma as decimal separator in all outputs (SAS 9.4)
My data has '.' as decimal separator, but that's not the problem for me.
I want all outputs in SAS to use comma as decimal separator, and use dot as 3-digit separator, but I don't find a global ...
0
votes
1
answer
4k
views
how to control decimal point in SAS output dataset?
I am new to SAS programming and I trying to work on proc means statement.
For controlling my decimal value in the output I have used maxdec option however when I tried to assign a new dataset to the ...
0
votes
1
answer
78
views
How do I compare a value to a decimal using a comma separator? [duplicate]
I have some decimal input from my DataGridView; let's say 4,3.
I want to compare if it is between 3,5 and 4,4.
How should I write the numbers 3,5 and 4,4 in my code?
With my current attempt, I get ...
0
votes
3
answers
1k
views
Decimal point of a float
I am still quite new in the C++ business.
I want to output a float number with only one decimal number.
At first I thought it would work with Modulo (%), but I quickly discarded this. Then I wanted to ...
3
votes
1
answer
10k
views
Convert decimal point number to integer - PowerShell
I am writing a PowerShell script that converts a number with a decimal point into an integer.
$val = 1024.24
How to convert this value to integer? (I want it to be 1024)
1
vote
0
answers
71
views
selector { text-align: "." right; }
I'm extremely new to coding so forgive if this is a basic question; however, I need a little direction and hope someone is able to provide an answer.
I'm reading an article pertaining to the alignment ...
1
vote
2
answers
116
views
How do I output a result to the number of decimal-points user previously entered (C)?
I'm trying to output my results to the decimal accuracy the user has input. In other words, if they enter 145, then it outputs to 0 d.p. - if they enter 145.67, it outputs the result to 2 d.p.
I've ...
0
votes
1
answer
167
views
Lagrange Polynomial
How to display coefficient of Lagrange function coefficients without rounding, without 10** or e form. At least monitor 30 decimals.
ex
f.coef
array([ 2.81360229e-12, -4.65044643e-09, 3.40515245e-06, ...
0
votes
2
answers
3k
views
PostgreSQL how to read csv file with decimal comma?
I try to read a csv file containing real numbers with a comma as separator. I try to read this file with \copy in psql:
\copy table FROM 'filename.csv' DELIMITER ';' CSV HEADER;
psql does not ...
3
votes
2
answers
1k
views
Adding two zeroes after decimal output
I've looked this up and I haven't gotten anything to work yet, but basically I need this code:
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
...
2
votes
3
answers
512
views
How to make a number from string with comma separators in JavaScript ("23,21" ---> 23,21)
Does anyone know how to make a number from a string with comma separators, in JS.
I got: "23,21" and I want to get it as a number value.
"23,21" --> 23,21
0
votes
1
answer
57
views
processing of decimal numbers fails
I am trying to compare the numbers with another number and then classify it into a climate zone, but the following problem arises
I get data via a JSON file in that there are also decimal numbers with ...
1
vote
1
answer
2k
views
Regex Pattern validation in Java to match 2 decimal points
I need to validate a number pattern with 2 decimal points with after each decimal point it can contain only up to 2 digits. It can contain a whole number only up to 4 digits.
Ex: maximum value it can ...
0
votes
4
answers
2k
views
In Progress 4GL, is there a way to convert a string to a decimal without any loss in precision?
Say that I needed to turn the character variable "0.0000000001" into a decimal. But if I were to write out the following logic:
define variable tinyChar as character initial "0....