mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
modify GetNumberSignificantDigits
This commit is contained in:
parent
ad7a9926a5
commit
cf1f9f8d44
1 changed files with 4 additions and 4 deletions
|
@ -929,16 +929,16 @@ void UnitConverter::TrimString(_Inout_ wstring& returnString)
|
|||
unsigned int UnitConverter::GetNumberSignificantDigits(std::wstring value)
|
||||
{
|
||||
TrimString(value);
|
||||
int currentNumberSignificantDigits = value.size();
|
||||
unsigned int numberSignificantDigits = value.size();
|
||||
if (value.find(L'.') != value.npos)
|
||||
{
|
||||
--currentNumberSignificantDigits;
|
||||
--numberSignificantDigits;
|
||||
}
|
||||
if (value.find(L'-') != value.npos)
|
||||
{
|
||||
--currentNumberSignificantDigits;
|
||||
--numberSignificantDigits;
|
||||
}
|
||||
return currentNumberSignificantDigits;
|
||||
return numberSignificantDigits;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue