What is the maximum efficiency of java to get the value after the decimal point of a floating point type?

I use this operation in a loop that is called frequently.
I think using String intercepting and BigDecimal will produce a large number of objects, so it"s not appropriate
what I"m doing now is

.
    float total = total;
    int left = ((int) (total));
    int right = (int) ((total - left)*100);

this way to avoid generating a large number of objects, one problem is that it is not well rounded. Is there any other efficient way?

Mar.01,2021

  

based on the java basis, the code universe is recommended.

Menu