I need to print int value in custom format:
for example int 9888222 should be printed as ‘> 9.888.222’.
So, rules of output are:
- Insert ‘.’ after every 3 digits. Starting from the end of the number of cause.
- Add ‘> ‘ string in the beginning of the output string.
More examples:
- 7000 -> ‘> 7.000’
- 722333 -> ‘> 722.333’
- 8223344 -> ‘> 8.223.344’
- 120200300 -> ‘> 120.200.300’
No values bigger than int maximum value.
Is it possible at all? What functions can be used?
1 Answer