c++ convert a fractional part of a number into integer
问题 I needed to convert a fractional part of a number into integer without a comma, for example I have 3.35 I want to get just 35 part without zero or a comma, Because I used the modf() function to extract the the fractional part but it gives me a 0.35 if there is any way to do that or to filter the '0.' part I will be very grateful if you show me how with the smaller code possible, 回答1: A bit more efficient than converting to a string and back again: int fractional_part_as_int(double number, int