MathUtils Extension (My First Extension)

Today I Present My First Extension ‘MathUtils’ Extension.


Introduction:

MathUtils Extension will allow you to quickly perform such functions as:

  • Simple Mathematics (Addition, Subtraction, Multiplication etc…)

  • You Can Convert Numbers to its Short Form like 1000 = 1k, 56000 = 56k.

  • Format a Number to a Default Format.

  • Customize the Formatting of a Number.

  • Put a Separator into Your Number.

& Much More…


Picture of All the blocks.


Documentation:

image

Format
Format a Number to a Default Number.

Number •Numbers to be Formatted in Meters, BytesBytes or Grams.

Format •Format to:
1 = Cm
2 = Km
3 = GB
4 = MB
5 = Kg


image
Custom Format
Customize the Formatting of a Number.

Number •The Number to be Formatted.
Prefix and Sufix •Prefix/Suffix Your Number with anything. Leave an Empty String, If you don’t want to Prefix/Suffix.
multipyFor •Multiply Your Number for Other. If you don’t want to use this, Put 1.


image
Separate
Put a Separator into Your Number.

Number •The Number You want to Add Separator.
Separator •The Separator You want to Use in Your Number.


image
Indirect Methods

These are Methods that will raise the Indirect Formatting Event with the value instead of Returning it. This will beUseful if you want to do something after Formatting.


image
Error
error Message
An Error Occured

1 = You must Choose a Valid Default Format: Direct Method.
2 = You must Choose a Valid Default Format: Indirect Method.


image
IndirectFormatting
Event Raised When You use Indirect Methods.

The Return Value of the Method.


image
Convert
Convert Number to its Short Form.

Value •Which You want Convert in Short Form.


& About Other Blocks, You know How to use it.


Like And Post, How was My Guide.


& If You think this Feature Should be Added, You can PM me or Post here.


I am Trying to Add more Features.


& If You find any bug Let me know.


Thanks For Reading my this Post.


Extension Download Link:
MuhammadMathUtils.aix (10.3 KB)


Extension Built - January 7, 2021

16 Likes

Great!

Keep koding!

2 Likes

Thanks @lleggend .

Congratulations on the extension.

2 Likes

Thanks for the great extension. You saved almost 50-60 blocks in my app. :relieved:

1 Like

Thanks @golumaths100 and @Douglas_Maueski.

2 Likes

How To Use Dosen’t work Convet String Plz Upload some example or .aia

What’s not working ? Post a screenshot of your blocks

Here is my block. when I cross 999m it shows an error Do It Result: Given Value Is Too Big To Convert

Yes it doesn’t work, just tested. What exactly do you want to do, most probably can be done with blocks

I want to check how many users have downloaded or viewed my file. That too in short form just like 1k 10k 100m 1b etc.

Create a procedure like this