[C] float with 2 decimal places

Hi!

I need a little help with C.
As my title suggests, I would like to know how to convert a number like 5.220000000 to 5.22

Do you have any ideas?
Thanks
Configuration: Windows Vista Safari 525.19

1 answer

  • Votes
  • Date
  • Descending date
  1. If it's for display; printf("%.2f", number);
    1. thank you!!!!!!!!!!!!!!!!
    2. Thank you very much.