[C] float with 2 decimal places

jc -  
 omam4701 -
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

  1. loupius
     
    If it's for display; printf("%.2f", number);
    65
    1. jc
       
      thank you!!!!!!!!!!!!!!!!
      0
    2. omam4701
       
      Thank you very much.
      0