question

brendan avatar image
brendan asked

Floating point statistics/leaderboards

Question from a developer:

Is there any way to use floating point values instead of decimal in statistics/leaderboards?

Leaderboards and Statistics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The PlayFab leaderboards are specifically Int32 values, for a variety of reasons, with consistency (float/double values are imprecise) and performance/cost being the primary concerns (and they're 32 bit in order to be compatible with languages which don't support 64 bit).

The best way to manage this would be to use a calculation to "shift" your floating point value into an Int32, and then re-compute the floating point value on the client when you want to display the information to the user.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.