Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The In-Portal uses "sprintf" to format and round numbers in single step before displaying them. Unfortunately due nature of how floating point numbers are stored theĀ 145.575 number is transformed into 145.57 instead of 145.58.

Solution

To solve this I propose to round numbers to desired precision before passing them to "sprintf" function. Trick is in retrieving needed precision from format passed to "sprintf" function.

Related Discussions

Related Tasks

  • No labels