diff --git a/common/include/Utilities/FixedPointTypes.inl b/common/include/Utilities/FixedPointTypes.inl index 248d2d2838..5c1d1f7fe4 100644 --- a/common/include/Utilities/FixedPointTypes.inl +++ b/common/include/Utilities/FixedPointTypes.inl @@ -157,7 +157,7 @@ FixedInt& FixedInt::SetFraction( u32 fracpart ) template< int Precision > wxString FixedInt::ToString() const { - return wxsFormat( L"%d.%d", GetWhole(), (GetFraction() * 100) / Precision ); + return wxsFormat( L"%d.%02d", GetWhole(), (GetFraction() * 100) / Precision ); } template< int Precision > @@ -167,7 +167,8 @@ wxString FixedInt::ToString( int fracDigits ) const pxAssert( fracDigits <= 7 ); // higher numbers would just cause overflows and bad mojo. int mulby = (int)pow( 10.0, fracDigits ); - return wxsFormat( L"%d.%d", GetWhole(), (GetFraction() * mulby) / Precision ); + wxString fmt=wxsFormat(L"%%d.%%0%dd", fracDigits); + return wxsFormat( fmt, GetWhole(), (GetFraction() * mulby) / Precision ); } template< int Precision >