UE5 : Is float not enough precise ?

Hello Everyone !

I have a little problem (no pun intended),

I have a series of float like this :

  • 0.0042199402
    and it shows on the details panel :
  • 0.00422

Even with double, it stills lose some precision.
And even when I try to show it with UE_Log(,,TEXT(“%f”), myFloat), it is not the good one…

The floats are from a json file that I convert to a TArray<MyStruct>, and the struct is a bunch of float.
The convertion is with : FJsonObjectConverter::JsonArrayStringToUStruct

Could someone enlight me ?

Have a nice day

NOT A SOLUTION

It’s a “quick fix that will probably be there for the rest of the project” :grimacing:

So, if numbers are precise with multiple “0.000” at the start,
Just export it with a “multiplicator” (for exemple, my 0.0042199402 is Kg, so I put it in g to have 4.2199402).
If some calculus are in the party project, remember to do the final '/' :exclamation:

Again, it is not a solution, and I still would like to know why float, rounds, at the 7 digit (32bit)…
I maybe misread information about “float are now double” or misunderstood. :sweat:

Have a nice day all :wave:

Honestly I do that a lot (I mean multiplying floats) just becuase working with 0.00012312 numbers is a pain haha. Like using sliders or something? No go. I didn’t see that as a hacky solution, but maybe it is.