in my application, I need to send time to the game center, and I need to show that Elapsed Time is the second format for the hundredth time.
00: 00: 00.00
This is the format that I want to show on the leaderboard.
In my application, I get the time in the following format
ss.SS
ss = seconds SS = hundredth of a second
i converts the value to double before sending it to the game center
double newScoreDouble = [newScore doubleValue];
But when I send a double account to the game center, he asks me to convert it to int64_t format. But when I convert it to this format, it loses part of the double value.
double intPart = 0; double fractPart = modf(newScoreDouble, &intPart); int isecs = (int)intPart; int min = isecs / 60; int sec = isecs % 60; int hund = (int) (fractPart * 100); int64_t time_to_send_through_game_center = min*6000 + (sec*100 + hund);
so I convert double to int64_t
Can anyone tell me how to send an integer double value to the game center and display it in the Elapsed time - up to the hundredth second format.
thanks
source share