Discuss Scratch

ajlim0403
Scratcher
54 posts

Number counter with letters

Title says what I need - Example, 1,000,000 would turn into 1M, 1,242,351 would be 1.24M, etc
penguincoder408
Scratcher
11 posts

Number counter with letters

iffoo>1000000thenset footojoinfoo/1000000M

Last edited by penguincoder408 (Sept. 17, 2022 22:03:22)

penguincoder408
Scratcher
11 posts

Number counter with letters

Delete

Last edited by penguincoder408 (Sept. 17, 2022 22:05:23)

awesome-llama
Scratcher
1000+ posts

Number counter with letters

I have a project that does that:
https://scratch.mit.edu/projects/502790430/


The basic process is you find how big the number is, then divide/round it to be smaller and put the symbol after based on how large it was.
There are a bunch of mathematical operators needed to do this in 1 line like I show but an alternative and probably simpler to understand method is what penguincoder408 shows above.
ajlim0403
Scratcher
54 posts

Number counter with letters

awesome-llama wrote:

I have a project that does that:
https://scratch.mit.edu/projects/502790430/


The basic process is you find how big the number is, then divide/round it to be smaller and put the symbol after based on how large it was.
There are a bunch of mathematical operators needed to do this in 1 line like I show but an alternative and probably simpler to understand method is what penguincoder408 shows above.
Thanks a lot

Powered by DjangoBB