Unit Converter - Calculate the rounding precision of results based on the source (#498)

* precisely calculates the number of digits of the source and compute the number of significant digits of the result based on that.

* fix unit test

* Fix warning C4267

* Optimize how we calculate the number of digits in the integer part and don't trim the value when used by the currency converter

* modify GetNumberSignificantDigits

* fix CI error

* Access to wstring::npos from static calls

* Move UnitConverter static methods related to number to NumberFormattingUtils

* rename namespace

* Add comment and fix typo

* Move standard headers
This commit is contained in:
Rudy Huyn
2019-07-16 17:00:57 -07:00
committed by Pepe Rivera
parent 1b9d6b8fbe
commit 2ff7bb4089
9 changed files with 251 additions and 82 deletions

View File

@@ -20,3 +20,5 @@
#include <unordered_map>
#include <vector>
#include <winerror.h>
#include <iostream>
#include <math.h>