Fixed Issue 1311: UI percentage values sometimes save incorrectly to ini file.

All UI percentage values (framerates, zoom) are saved incorrectly when the number ends with 0n (e.g. 105 is saved as 150, 307 is saved as 370, etc). The problem becomes apparent when these values are loaded from the ini file after restarting pcsx2.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5369 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
avihal 2012-08-14 07:15:27 +00:00
parent f19c0b7ca9
commit 42f3f9526f
1 changed files with 3 additions and 2 deletions

View File

@ -157,7 +157,7 @@ FixedInt<Precision>& FixedInt<Precision>::SetFraction( u32 fracpart )
template< int Precision > template< int Precision >
wxString FixedInt<Precision>::ToString() const wxString FixedInt<Precision>::ToString() const
{ {
return wxsFormat( L"%d.%d", GetWhole(), (GetFraction() * 100) / Precision ); return wxsFormat( L"%d.%02d", GetWhole(), (GetFraction() * 100) / Precision );
} }
template< int Precision > template< int Precision >
@ -167,7 +167,8 @@ wxString FixedInt<Precision>::ToString( int fracDigits ) const
pxAssert( fracDigits <= 7 ); // higher numbers would just cause overflows and bad mojo. pxAssert( fracDigits <= 7 ); // higher numbers would just cause overflows and bad mojo.
int mulby = (int)pow( 10.0, fracDigits ); 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 > template< int Precision >