Questions tagged [decimal-point]

The character or glyph used to separate the integer part from the fraction part in a decimal number. Usually either a dot or a comma.

378 questions
4
votes
1 answer

How to handle comma separated decimal values in Hive?

I have one CSV file and metadata for the same. Columns in this CSV is are delimited by pipe | symbol. Sample data is as follows: name|address|age|salary|doj xyz | abcdef|29 |567,34|12/02/2001 Here salary column is of type decimal but instead of…
Shekhar
  • 10,233
  • 31
  • 116
  • 179
4
votes
4 answers

How to find 10's complement of decimal number

Whats the 10's complement of 1056.074? Please check the solution: 9999.999 - 1056.074 = 8943.925 (9's complement of 1056.074) Now 1 is added to .074 or 8943?
user5011938
4
votes
0 answers

Change decimal separator in GDB

Is there a way to change decimal separator in gdb, without changing it in the whole system? I have a French ubuntu 14.04 (with comma as decimal separator). But in gdb, any floating point written with a dot (for example p 2.0) leads to "invalid…
Greg82
  • 911
  • 2
  • 10
  • 21
4
votes
4 answers

Inconsistent behavior of conversion to/from locales

I'm noticing strange and anoying behavior in excel probably due to the different number notation in Belgium. When I type this in the immediate window, I get counter-intuitive results: ?val("0,5") 0 ?val("0.5") 0,5 so my workaround is to use it…
oneindelijk
  • 518
  • 1
  • 5
  • 16
4
votes
1 answer

The Val() function doesn't recognize system-wide decimal point

The val() function seems to understand . as a decimal point, even on systems with , as a decimal point. For example, the following call val("7,3") + 1,4 returns the real number 8,4 (8.4 in English notation). val("7.3") + 1,4 returns the expected…
Tomas
  • 52,167
  • 46
  • 207
  • 345
4
votes
3 answers

How do I set Chrome to use a period as a decimal instead of a comma?

The following HTML5 code works. It allows a user to capture decimals using the HTML5 type="number" input type. This is made possible by the step attribute: The…
sparkyspider
  • 11,590
  • 8
  • 73
  • 113
4
votes
0 answers

python float got a colon after the decimal point after addition

In my python program, I got two floating numbers -2901.0, -200.0 during some process. When I tried to add them directly I got -3100.: (If I converted it to str, it would be "-3100.:") Python didn't say any error in the program. But the result…
chy
  • 49
  • 1
3
votes
5 answers

How do you calculate floating point in a radix other than 10?

Given Wikipedia's article on Radix Point, how would one calculate the binary equivalent of 10.1 or the hex equivalent of 17.17? For the former, what is the binary equivalent of a tenth? For the latter, the hex representation of 17/100? I'm looking…
bugmagnet
  • 7,233
  • 7
  • 57
  • 121
3
votes
1 answer

Converting float to varchar with correct decimal separator

Hi i'm living in austria and we use the , as decimal separator. It seems to be impossible to convert the float to varchar with the correct separator according to the language/collation setting? Is this a bug? set language german --makes no…
3
votes
1 answer

DataGridView: DefaultCellStyle working with decimals

I am using a Datagidview control on winforms. This is getting filled dynamically. I am trying to display 4 decimal format number in the grid. I applied the DefaultCellStyle property as; dataGridViewCellStyle2.Format =…
Vijay Balkawade
  • 3,574
  • 12
  • 49
  • 87
3
votes
2 answers

Add a decimal to a string

I have a script that takes a big number and counts up. The script converts the number to a string so that it can be formatted with commas, but I also need to add a decimal place before the last two digits. I know that this line handles the…
blackessej
  • 666
  • 1
  • 15
  • 34
3
votes
2 answers

Calculate Square root to decimal places in bash

I am writing a simple bash script to calculate a square root to 3 decimal places by default but the user can set the number of places... Nothing complex, I just iterate from 1 to the lowest square root. Since my bash is still basic this is what I…
Aderemi Dayo
  • 607
  • 9
  • 20
3
votes
5 answers

How to get decimal parts in integer from double?

How to separate double into two integer number? First number before and second number after decimal point. For example: double doub = 543.345671; int num1 = (int) doub; //543 int num2 =…
3
votes
1 answer

my output does not show more than 6 decimal place after converting fractional decimal to binary. I need 12 decimal place

int main(){ long double fraDecimal,fraBinary,bFractional = 0.0,dFractional,fraFactor=0.1; long int dIntegral,bIntegral=0; long int intFactor=1,remainder,temp,i; printf("Enter any fractional decimal number: "); …
3
votes
2 answers

Printing to specific (runtime-determined) precision in Julia

Given a value x and an integer n (assigned at runtime), I want to print x to exactly n digits after the decimal (after rounding if needed). print(round(x, n)) works fine for (x,n)=(3.141592, 3) but for (x,n)=(2.5,5), it prints just 2.5, not 2.50000…
sundar - Remember Monica
  • 6,647
  • 5
  • 40
  • 66