HelTecAutomation / CubeCell-Arduino

Heltec CubeCell Series (based on ASR6501, ASR6502 chip) Arduino support.
256 stars 140 forks source link

fracPart function #242

Open gibus27 opened 2 years ago

gibus27 commented 2 years ago

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