playMaker

Author Topic: (Solved) Display score in "K"  (Read 391 times)

heavygunner

  • Full Member
  • ***
  • Posts: 168
    • View Profile
(Solved) Display score in "K"
« on: October 18, 2018, 11:16:51 AM »
Hi !

How to display score in "K" ?
For example, If score is 12748, it show 12.74 K

:)
« Last Edit: October 19, 2018, 02:19:01 AM by heavygunner »

Thore

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Re: Display score in "K"
« Reply #1 on: October 18, 2018, 02:11:46 PM »
If it's just K, divide by 1000, rounding down, and adding a K. Check the math actions, and build string.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14593
  • Official Playmaker Support
    • View Profile
Re: Display score in "K"
« Reply #2 on: October 19, 2018, 02:05:12 AM »
Hi,

 yes, sounds like the right approach, you can find some code samples on how to do a proper formatter for this:

https://stackoverflow.com/questions/2134161/format-number-like-stack-overflow-rounded-to-thousands-with-k-suffix

 Bye,

 Jean

heavygunner

  • Full Member
  • ***
  • Posts: 168
    • View Profile
Re: Display score in "K"
« Reply #3 on: October 19, 2018, 02:18:37 AM »
Yay !
Did that :)

Thanks