playMaker

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

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
(Solved) Display score in "K"
« on: October 18, 2018, 02:16:51 PM »
Hi !

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

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

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Display score in "K"
« Reply #1 on: October 18, 2018, 05: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: 15500
  • Official Playmaker Support
Re: Display score in "K"
« Reply #2 on: October 19, 2018, 05: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

  • Sr. Member
  • ****
  • Posts: 344
Re: Display score in "K"
« Reply #3 on: October 19, 2018, 05:18:37 AM »
Yay !
Did that :)

Thanks