forked from Alepha/Alepha
Fix bug in number printing.
This commit is contained in:
@ -78,16 +78,20 @@ namespace Alepha::Hydrogen::Utility ::detail:: print_number_m
|
||||
value/= 1000;
|
||||
if( not remainder ) continue;
|
||||
std::string next;
|
||||
if( remainder >= 100 ) next+= names.at( remainder / 100 ) + " hundred ";
|
||||
if( remainder >= 100 ) next+= names.at( remainder / 100 ) + " hundred";
|
||||
remainder%= 100;
|
||||
if( remainder >= 20 )
|
||||
if( remainder )
|
||||
{
|
||||
next+= tens.at( remainder - remainder % 10 );
|
||||
if( remainder % 10 ) next+= " " + names.at( remainder % 10 );
|
||||
}
|
||||
else if( remainder )
|
||||
{
|
||||
next+= names.at( remainder );
|
||||
next+= " ";
|
||||
if( remainder >= 20 )
|
||||
{
|
||||
next+= tens.at( remainder - remainder % 10 );
|
||||
if( remainder % 10 ) next+= " " + names.at( remainder % 10 );
|
||||
}
|
||||
else
|
||||
{
|
||||
next+= names.at( remainder );
|
||||
}
|
||||
}
|
||||
next+= " " + powers.at( millennium );
|
||||
parts.push_back( std::move( next ) );
|
||||
|
||||
Reference in New Issue
Block a user