Facing issue converting 10.5 to 10.499999999`

Hi Team,

I’m facing issue while value is getting converted .I’m getting the value as 10.5 but its convert to 10.4999999 I don’t know why this issue occur. Can you people kindly help me on the same asap

Thanks & Regards

Nareshkumar

Why this is an issue for you? It is the same value for all practical purposes.

It’s probably got to do with the floating point representation of the number. Druid doesn’t have a true “decimal” type – it uses 32 or 64 bit floating points.

Hi Team,

I even seen the input file which about to process there value is given 10.50 but after processing in Durid value as come as 10.4999999999 . This same value is displayed in UI too. It’s not display 10.50 in UI.Kindly help me out

Thanks in advance

cast it back to float, something like

String valueDruidGives = “10.49999”;

float valueYouNeed = Float.valueOf(valueDruidGives).

It works for me.