From 40f6b3fbd1d39779abea42e0452e01936682b8df Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 29 Oct 2020 22:45:25 +0900 Subject: [PATCH] Fixes --- src/main.cpp | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 981c5ec..8b9d634 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,60 +25,87 @@ std::u8string value_to_korean(unsigned long long value) { unsigned long long temp; if(temp = (value / 1000000000000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(man); } if(temp = (value / 100000000000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(chun); } if(temp = (value / 10000000000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(bec); } if(temp = (value / 1000000000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(ship); } if(temp = (value / 100000000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(uc); } else if(!s.empty()) { s.append(uc); } if(temp = (value / 10000000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(chun); } if(temp = (value / 1000000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(bec); } if(temp = (value / 100000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(ship); } if(temp = (value / 10000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(man); } else if(!s.empty()) { s.append(man); } if(temp = (value / 1000) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(chun); } if(temp = (value / 100) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(bec); } if(temp = (value / 10) % 10; temp > 0) { - s.push_back('0' + temp); + if(temp != 1) { + s.push_back('0' + temp); + } s.append(ship); } if(temp = value % 10; temp > 0) { s.push_back('0' + temp); } + if(s.empty()) { + s.push_back('0'); + } s.append(won); return s;