playMaker

Author Topic: [SOLVED] Formatting "Big" Numbers in Idle Games  (Read 1233 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
[SOLVED] Formatting "Big" Numbers in Idle Games
« on: September 16, 2019, 04:52:56 PM »
Hi !

Making an Text based Idle game. Now, I have to display some big numbers on UI.


Let's say Balance is something between 1 Million - 1 Billion. So, I divide that number by 1 Million. Then, store it on a float then convert to string and build string float+ Mn will show the Cash balance.

This is working Problem is, when it goes more big number, How to do that ?

I have to check it's max and min value. if it's in range then okey, If not? i am confused.

Thanks
« Last Edit: September 17, 2019, 02:35:29 AM by heavygunner »

heavygunner

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Re: Formatting "Big" Numbers in Idle Games
« Reply #1 on: September 17, 2019, 02:35:07 AM »
A silly mistake made my works mess. I just changed to Less Than from greater Than. it worked.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15426
  • Official Playmaker Support
    • View Profile
Re: Formatting "Big" Numbers in Idle Games
« Reply #2 on: September 17, 2019, 02:50:49 AM »
Hi,

 first of all, I don't think that it make sense to work with such big numbers, the human mind will not be able to grasp it above a billion...


but here's how you can get it done:

you first check the range of the value



And then format it based on that range.



repeat for how big your number can be.

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15426
  • Official Playmaker Support
    • View Profile
Re: [SOLVED] Formatting "Big" Numbers in Idle Games
« Reply #3 on: September 17, 2019, 02:52:24 AM »
Hi,

 funny, we're on it together :)

 Don't do that everyframe, this is a total waiste of performances, do that only per request, when you know that the input has changed.

also, you can learn more about string formatting here.

Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5795
    • View Profile
    • jinxtergames
Re: [SOLVED] Formatting "Big" Numbers in Idle Games
« Reply #4 on: September 17, 2019, 08:34:11 AM »
Hi.
I worked on an idle game before and i had it setup like this :

(i just created a quick fsm to show the system, this is not from the original game)


Recheck was send when a purchase is done.

But i believe that i did that also convert every frame as the value is constantly changing.
i will look if i can find the project back