@ -117,22 +117,22 @@ char *generateCheckString(unsigned int customerID, char *customerPassword)
return checkString ;
}
double stod ( char * s )
double balanceToDouble ( char * balanceA sString )
{
double result , power ;
int i = 0 , sign ;
sign = ( * ( s ) = = ' - ' ) ? - 1 : 1 ;
if ( * ( s ) = = ' + ' | | * ( s ) = = ' - ' ) {
sign = ( * ( balanceA sString ) = = ' - ' ) ? - 1 : 1 ;
if ( * ( balanceA sString ) = = ' + ' | | * ( balanceA sString ) = = ' - ' ) {
+ + i ;
}
for ( result = 0.0 ; * ( s + i ) ! = ' . ' ; + + i ) {
result = 10.0 * result + ( * ( s + i ) - ' 0 ' ) ;
for ( result = 0.0 ; * ( balanceA sString + i ) ! = ' . ' ; + + i ) {
result = 10.0 * result + ( * ( balanceA sString + i ) - ' 0 ' ) ;
}
if ( * ( s + i ) = = ' . ' ) {
if ( * ( balanceA sString + i ) = = ' . ' ) {
+ + i ;
}
for ( power = 1.0 ; * ( s + i ) ! = ' \0 ' ; + + i ) {
result = 10.0 * result + ( * ( s + i ) - ' 0 ' ) ;
for ( power = 1.0 ; * ( balanceA sString + i ) ! = ' \0 ' ; + + i ) {
result = 10.0 * result + ( * ( balanceA sString + i ) - ' 0 ' ) ;
power * = 10.0 ;
}
return sign * result / power ;