Member #1181579

Member Since: October 19, 2017

Country: Albania

  • Thank you for your quick reply and for solution !

    I found a solution but your solution is the right.

    this is my solution: double B = (int) (currentReading * 1000.0 ) / setting_division_value ;

    double C = (B * 1000.0 + 0.5) / 1000.0 ;

    double D = (C / 1000.0) * setting_division_value ;

    double R = (D * 1000.0 + 0.5) / 1000.0 ;

    "setting_division_value" is saved in the memory by the user.

    Regards,

  • Can anyone help me to solve this problem. I want to round three decimals with the number assigned by a graduator 2 gr ,5 gr, 10 gr, 50 gr ,100 gr. For example, if we have currentReading 1.251 kg and we want the accuracy of 5 gr the total weight must be displayed 1.250 and if we have currentReading 1.253 kg weight must be displayed 1.255 and so on.. Thanks in advance!

No public wish lists :(