1 * 20/100 = 0.2
I want to store the same value in database how can i do that
I have give column type as Decimal
and the lenght automatically taking as (10,0)
My issue is it is storing as 0 instead of 0.2
1 * 20/100 = 0.2
I want to store the same value in database how can i do that
I have give column type as Decimal
and the lenght automatically taking as (10,0)
My issue is it is storing as 0 instead of 0.2
No datatype will store
1/3
exactly.Your example of
20/100
implies the need forDECIMAL(..., 2)
, where the...
is a suitable maxinum number of digits including the2
.Without further insight into where the numbers are coming from or how they will be used, we cannot discuss this further.