How do I auto simplify my numbers?

Ok, so on my Cookie Clicker type game, would it be possible to make a system (or is there an extension) to make it to where when I have lets say 1000000 it will auto say 1M or if I have 1900000 it will say 1.9M? I really would like to know if this is a thing because it would be soooo helpful.

Thanks in advance.

Try This-

Example
image

A small edit added

Okay, I'll try it out.

1 Like

also can I get aia file so I can just use backpack to quickly yoink?

Hi just drag that blocks image to your blocks editor workspace

okay! will do!

image is this supposed to happen?

image this is my code blocks

Yes, That is suppose to happen because you entered a big number.

Okay, thank you!

1 Like

If your problem is solved click on the Solution button.

1 Like

Just curious. Could you show some screenshots of your game?

hold on im doing something that might work a lil better off of your design

theres literally basically nothing to show, its a picture of a cookie you can click on and a a little text box thingy that shows how many you have

I once made this basic design of a cookie clicker game.

1 Like

The @Alpha2020 technique gets even simpler if the comparisons are done in reverse order, from large to small.
That eliminates the need for the and conditions ...

(Draggable)

4 Likes

dang, this is much easier, thanks!

So if input is 1234567890, the output is 1.23456789G. I don't think it's simpler

There's a format as decimal math block you can use to cut off extra decimals, per your taste. Apply it at the outermost layer of the if/then/else tree, so that you don't have to repeat it on every branch.

Correction - it would choke on the trailing letters. You would need to do it before each JOIN. Alternatively, use the math dividend block instead of the / block for the division, to abandon all fractional parts.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.