CubeCell-Arduino icon indicating copy to clipboard operation
CubeCell-Arduino copied to clipboard

fracPart function

Open gibus27 opened this issue 3 years ago • 0 comments

I think fracPart function has an issue. Imagine Val = 1.027 and n=3. Result is 27 and not 027. I think fracPart can't return an integer but a string. Then value displayed is 1,27 and not 1,027.

int32_t fracPart(double val, int n) { return (int32_t)((val - (int32_t)(val))*pow(10,n)); } Alain

gibus27 avatar Jun 29 '22 14:06 gibus27