Conversion

Conversion of value from one type to another


Syntax

<destination-Type>(value)

Example:

var a = 10
string(a)

Notable

  • Conversion from float to int will truncate the decimal part.
var a = 10.5
int(a)
// 10
  • Conversion from string to int will truncate non-numeric and numeric characters after first non-numric character.
var a = "10asd123asd"
int(a)
// 10
  • Conversion from string to float will truncate non-numeric and numeric characters after first non-numric character.
var a = "10.5asd123asd"
float(a)
// 10.5

    Theme

    Presets

    Background

    Custom:

    Primary

    Custom:

    Secondary

    Custom:

    Border

    Custom:

    Mode

    Light
    Dark