Search code examples
google-play-servicesleaderboard

Does Google Play Service Leaderboard allow for negative numbers where negative is better?


The Google Play Services Leaderboard documentation here:

https://developers.google.com/games/services/common/concepts/leaderboards

does not provide an answer to if you can have negative numbers whereby:

-1.76% is a better score than -0.3% or 1.2%

Anyone know the answer?

For reference:

You can set numbers to be better when smaller: You can set numbers to be better when smaller

I can add percentage sign I can add percentage sign

But i'm just not sure if negative is possible considering:

"A score of 314159, for example, would be displayed as 3.14159, 3141.59, or 314159, depending on the decimal place you specified."

Would i put in -176? for example?


Solution

  • The answer is yes. I fired up Google play services and got a test leaderboard set up to try it out.

    If you want -0.35 for example, you would ensure your leader board has 2 floating points and you would pass it -35. This will create -0.35

    If you wanted -3.45 you would pass it -335