EgtGeneral :

- Spostato nell'header il corpo di ToString per interi.
This commit is contained in:
Dario Sassi
2014-09-13 21:23:47 +00:00
parent c239649f0d
commit 11d7adb04c
-28
View File
@@ -20,34 +20,6 @@
using namespace std ;
//----------------------------------------------------------------------------
const string
ToString( int nVal, int nPrec)
{
int nErr ;
int nLen ;
char szBuff[24] ;
// eseguo conversione
nErr = _itoa_s( nVal, szBuff, 10) ;
// se errore, ritorno stringa opportuna
if ( nErr != 0) {
_ASSERT( 0) ;
return "#Error" ;
}
// verifico lunghezza minima
if ( ( nLen = (int) strlen( szBuff)) >= nPrec)
return szBuff ;
// porto la stringa alla minima lunghezza
string sBuff( szBuff) ;
sBuff.insert( 0, ( nPrec - nLen), '0') ;
return sBuff ;
}
//----------------------------------------------------------------------------
const string
ToString( double dVal, int nPrec)