This commit is contained in:
Stephen Seo 2020-10-29 22:45:25 +09:00
parent a522aae261
commit 40f6b3fbd1

View file

@ -25,60 +25,87 @@ std::u8string value_to_korean(unsigned long long value) {
unsigned long long temp; unsigned long long temp;
if(temp = (value / 1000000000000) % 10; temp > 0) { if(temp = (value / 1000000000000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(man); s.append(man);
} }
if(temp = (value / 100000000000) % 10; temp > 0) { if(temp = (value / 100000000000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(chun); s.append(chun);
} }
if(temp = (value / 10000000000) % 10; temp > 0) { if(temp = (value / 10000000000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(bec); s.append(bec);
} }
if(temp = (value / 1000000000) % 10; temp > 0) { if(temp = (value / 1000000000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(ship); s.append(ship);
} }
if(temp = (value / 100000000) % 10; temp > 0) { if(temp = (value / 100000000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(uc); s.append(uc);
} else if(!s.empty()) { } else if(!s.empty()) {
s.append(uc); s.append(uc);
} }
if(temp = (value / 10000000) % 10; temp > 0) { if(temp = (value / 10000000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(chun); s.append(chun);
} }
if(temp = (value / 1000000) % 10; temp > 0) { if(temp = (value / 1000000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(bec); s.append(bec);
} }
if(temp = (value / 100000) % 10; temp > 0) { if(temp = (value / 100000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(ship); s.append(ship);
} }
if(temp = (value / 10000) % 10; temp > 0) { if(temp = (value / 10000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(man); s.append(man);
} else if(!s.empty()) { } else if(!s.empty()) {
s.append(man); s.append(man);
} }
if(temp = (value / 1000) % 10; temp > 0) { if(temp = (value / 1000) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(chun); s.append(chun);
} }
if(temp = (value / 100) % 10; temp > 0) { if(temp = (value / 100) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(bec); s.append(bec);
} }
if(temp = (value / 10) % 10; temp > 0) { if(temp = (value / 10) % 10; temp > 0) {
if(temp != 1) {
s.push_back('0' + temp); s.push_back('0' + temp);
}
s.append(ship); s.append(ship);
} }
if(temp = value % 10; temp > 0) { if(temp = value % 10; temp > 0) {
s.push_back('0' + temp); s.push_back('0' + temp);
} }
if(s.empty()) {
s.push_back('0');
}
s.append(won); s.append(won);
return s; return s;