| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
Anybody here knows if there is some C/C++ code to "organize" numbers. Like: 1234567 and than i get: 1.234.567 Thanks, firewall |
|
#2
|
|||
|
|||
|
People ca't help you if you dont describe your problem precisely.
If the "organising" is always the same and the number is always of same lenght (like date): X.XXX.XXX (X are digits) then that's no problem. Just print the dot after ceratin number of digits (after first and fourth, and so on if you need) Say if you need the complete code. Tip: You may want to convert an integer to string for easier counting of numbers. |
|
#3
|
|||
|
|||
|
there is no such a function.
In printf function there is a lot of options you can use with number formatting, but there is no functionality you need. Check manual for printf (like: http://www.cplusplus.com/ref/cstdio/printf.html ). to print the number as you showed you should write it manually: Code:
void printnum(int num)
{
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Little help plz |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|