I want to know what kind of data to use for numbers that can be decimals but very high, like 10'000'000,123. I'm going to use it in Mysql, Java and Javascript. Thanks in advance.
I want to know what kind of data to use for numbers that can be decimals but very high, like 10'000'000,123. I'm going to use it in Mysql, Java and Javascript. Thanks in advance.
For MYSQL there is the data type Decimal decimal(x, y)
, where x
is the amount of number to be treated including decimals, while y
is the number of numbers of the decimal part, for the example that shows the serious field:
campo DECIMAL(11, 3)
In this way we can handle 11
numbers of which 3 are from the decimal part which gives us a range from -99,999,999.999 hasta 99,999,999.999.
Regarding Java, I would recommend using BigDecimal at least my has given me better results.
And in Javascript
you should not have problems in the same way in github there are several libraries for the use of BigDecimal
with its functions to make operations with them.