[Flutter]
[Flutter] Dart에서 sprintf 사용하기 / Formatting
Hevton
2022. 3. 27. 01:37
반응형
// https://stackoverflow.com/questions/9287063/does-dart-have-sprintf-or-does-it-only-have-interpolation
// https://mobile-app-developer.tistory.com/8
void main() {
int origin = 33;
String formatted = origin.toString().padLeft(5, "0");
print(formatted);
print(int.parse(formatted));
}
formatted = 5자리 숫자, 빈자리는 0으로
반응형