0

I'm unable to create a function that formate numbers like that :

1000 -> 1.000
1000000-> 1.000.0000
99999-> 99.999

is there any function in C for that? if it doesn't exist, can you give me an idea about how to it manually?
Thank you,

hereForLearing
  • 1,209
  • 1
  • 15
  • 33
  • 3
    transform to string -> iterate backwards -> print up to three characters -> you can work out the rest :) – OMGtechy Nov 19 '16 at 15:56
  • ..and what exactly have you tried so far? Have you searched for any functions existing or have you tried to implement something? – Peter Varo Nov 19 '16 at 15:56
  • @OMGtechy that's what i'm trying to do, but have some problems i'm trying to solve... Peter Varo , found a function to print ',' but I need '.', tried successive division but it was a stupid idea, and i'm still trying to fix the function that OMGtechy described – hereForLearing Nov 19 '16 at 16:03
  • @saywow think about how you'd do it as a human, write it out, then turn that into pseudo code – OMGtechy Nov 19 '16 at 16:04
  • "that's what i'm trying to do," --> better to post that code to clearly see the issues that simply describe the code. – chux - Reinstate Monica Nov 19 '16 at 19:47
  • yeah you're right i'm sorry ^^' anyway I've resolved the problem, but still can't post it since I can't answer my own question (yet), I'll post it asap – hereForLearing Nov 19 '16 at 21:57

0 Answers0