diff options
author | login <login@tilde.team> | 2023-11-22 09:54:04 +0000 |
---|---|---|
committer | login <login@tilde.team> | 2023-11-22 09:54:04 +0000 |
commit | 5128e4408d51d5d35af008fe8212a2ddde3bd798 (patch) | |
tree | 68a51350527d108781bc07dac27e6d4b9bd9289f | |
parent | ec88d6193483984a3a2f8351e40ff0994e7c0946 (diff) | |
download | tcoin-5128e4408d51d5d35af008fe8212a2ddde3bd798.tar.gz |
Fix to thousands separator function
The thousands separator function used to add leading zeros to numbers less than three digits. That has been fixed now.
-rw-r--r-- | tcoin.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tcoin.cpp b/tcoin.cpp index 2c728a2..e3bde74 100644 --- a/tcoin.cpp +++ b/tcoin.cpp @@ -399,13 +399,15 @@ void num_stream_thousands_sep(std::ostringstream& ss, long long int const& amoun mini_residue = mini_reduced_amount % 10; mini_reduced_amount /= 10; } - for(int i=num_residue_digits; i<3; ++i) - { - rev << 0; - } if(reduced_amount > 0) + { + for(int i=num_residue_digits; i<3; ++i) + { + rev << 0; + } rev << sep; + } residue = reduced_amount % 1000; residue_gte_100 = residue >= 100; |