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:
@@ -279,9 +279,7 @@ namespace UnitConversionManager
|
||||
double Convert(double value, ConversionData conversionData);
|
||||
std::vector<std::tuple<std::wstring, Unit>> CalculateSuggested();
|
||||
void ClearValues();
|
||||
void TrimString(std::wstring& input);
|
||||
void InitializeSelectedUnits();
|
||||
std::wstring RoundSignificant(double num, int numSignificant);
|
||||
Category StringToCategory(const std::wstring& w);
|
||||
std::wstring CategoryToString(const Category& c, const wchar_t* delimiter);
|
||||
std::wstring UnitToString(const Unit& u, const wchar_t* delimiter);
|
||||
|
||||
Reference in New Issue
Block a user