Digia Academy
Digia StudioDiscordLinkedIn
  • Introduction
    • FAQs
  • What's New
    • 2024
      • March
  • DIGIA STUDIO INTRODUCTION
    • Dashboard
    • Builder Tool
      • Navigation Menu
      • Tool Bar
      • Pages and Widgets Panel
      • Canvas Area
      • Properties Panel
    • Creating a New Project
    • Creating new Pages
    • Working with Widget Tree
    • Build Your First App
      • Hello World
      • Bytes App
        • Onboarding
        • Defining API Calls
        • Courses
        • Articles
        • Viewing your App
    • SDK Integration
      • Insert Single Pages from Digia Studio
  • Actions
    • Call API Rest Action
    • Call Rest API
    • Pop Current
    • Pop to Route
    • openUrl
    • Go To Page
    • Post Message
    • Set Page State
    • Wait (delay)
    • Drawer
    • Toast
    • Open Dialog
    • Share
    • Copy to Clipboard
  • Operations
    • API Call
    • Operators
      • Json Operators
      • Logical Operators
      • Date Time Operators
      • Math Operators
      • String Operations
  • BUILDING UI
    • Widgets
      • Form Widgets
        • PinField
        • Calendar
        • Text Form Field
      • Base Widgets
        • Animated Button
        • Check Box
        • Video Player
        • Spacer
        • Stack
        • Wrap
        • Text
        • Avatar
        • Rich Text
        • Image
        • Button
        • Icon
        • Switch
        • Sized Box
        • HtmlView
        • Lottie Animation
        • Linear Progress Bar
        • YouTube Player
        • Circular Progress Bar
      • Layout Widgets
        • ListView
        • Web View
        • Future Builder
        • Conditional Builder
        • Stream Builder
        • GridView
        • Column
        • Row
        • Container
        • Expandable
        • Divider (Horizontal)
        • Divider (Vertical)
        • Carousel
      • Persistent Footers Widgets
        • NavigationBar Widget
      • Page Widgets
        • Stepper Widget
        • Scaffold Widget
        • Paginated Listview Widget
        • TabView
        • AppBar
      • Widget Commonalities
    • Event Handlers
  • Theme
    • Colors
    • Typography
  • DATA AND BACKEND
    • API Calls
      • Setting up API Calls
      • Create API Calls
      • Import API From Curl
  • DEPLOYING YOUR APP
    • Deployment
    • Release History
  • Settings
    • App Settings
    • App Assets
    • Media Assets
  • JARGON
    • Data integration
Powered by GitBook
On this page
  1. Operations
  2. Operators

Math Operators

PreviousDate Time OperatorsNextString Operations

Last updated 2 months ago

There are various Math operators support on PIM's Dashboard

  • Addition Operator (sum)

  • Multiply Operator (mul)

  • Subtraction Operator(diff)

  • Divide Operator(divide)

  • Modulo Operator ( modulo )

  • Ceil Operator ( ceil )

  • Floor Operator ( floor )

  • Absolute Operator ( abs )

  • clamp Operator ( clamp )

  • numberFormat Operator

1. Addition Operator (sum)

when you want to sum couple of numbers than you can use sum operator

Arguments

This Operator can take upto 255 arguments

Example

sum(1,2,4); //this will return 7 as output

2. Multiply Operator (mul)

when you want to multiply couple of numbers than you can use multiply operator

Arguments

This Operator can take upto 255 arguments

Example

mul(1,2,4); //this will return 8 as output

3. Subtraction Operator (diff)

used to perform subtraction operation

Arguments

This operator will take two arguments and both arguments are required

Example

diff(5,2); 
// this will return 3 as output
// Explanation: 5-2 = 3

4. Divide Operator (divide)

used to perform divide mathematical operation

Arguments

This operator will take two arguments and both arguments are required

Example

divide(4,2); 
// this will return 2 as output
// Explanation: 4/2 = 2

5 . Modulo operator

Returns the remainder of division of first number by second

Arguments

This operator will take two number arguments

Example

modulo(5,2)
//it will return 1 as 5 divided by 2 leaves
// a remainder of 1

6 . Ceil operator

Rounds a number up to the nearest integer

Arguments

It will take one number argument

Example

ceil(4.5)
//it will output 5 as it is nearest up integer

7. Floor Operator

Rounds a number down to the nearest integer

Arguements

it will take one number arguement

Exampe

floor(4.5)
//it will output 4 as it is the nearest down integer

8 . Absolute Operator

Returns the absolute value of a number

1

Create a page state

for this example we created a page state variable var of type number

2

Enter an initial value to your state

we entered -10 as our intial value for our page state

Argument

it will take a page state arguement

abs(var)
//var = -10
//it will output 10,the absolute value of -10

9 . Clamp Operator

Restricts a value to be within the specified range [min, max]

Argument

 clamp(10,6,8)
//it will return 8 as 10 is out of bounds

10 . number format

Formats a number using the specified format. Defaults to '##,##,###

Arguments

requires a number and a format

Example

numberFormat(9883928872, '##,##,##')
//it will output 98,83,92,88,72