website logo
ChartHop documentation
Carrot reference
Release notes
Navigate through spaces
ChartHop documentation
Carrot reference
Release notes
⌘K
Getting started
Getting started with Carrot
Operator precedence
Filtering with Carrot
Data categories
Basic Org Information
Compensation
Job Changes
Permissions
Personal
Recruiting
Structure
Time off
Data types
Address
Boolean
Comp
Comp Band
Currency
Date
DateTime
DaysOff
Enum
EnumList
File
Group
Image
Job
List
Money
Name
Number
Null
Percent
Person
PersonList
Shares
StockGrant
String
TimeOff
User
Operators
+ (add)
- (subtract)
* (multiply)
/ (divide)
% (modulus)
&& (and)
|| (or)
if
: (match)
= (equals)
!= (not-equals)
! (not)
> (greater-than)
>= (greater-than-equals)
< (less-than)
<= (less-than-equals)
[ ](array)
. (dot)
? (ternary)
?: (elvis)
Functions
abs()
asOf()
boolean()
compHistory()
compBetween()
costBetween()
date()
day()
daysOffBetween()
diffYears()
diffMonths()
distance()
monthEnd()
formatMoney()
formatRound()
formatNumber()
formatPercent()
formatDate()
grantedShares()
length()
max()
mean()
money()
month()
min()
nextAnniversary()
number()
pluralize()
percent()
random()
round()
roundUp()
roundDown()
string()
subString()
stockPrice()
monthStart()
split()
vestValue()
vestShares()
year()
Aggregators
count{}
max{}
mean{}
min{}
sum{}
Docs powered by archbee 
5min

number()

Given a value, returns that value as a Number.

Syntax

number(value)

  • value - the Number, Money, Percent, Enum, Boolean, or String value to be converted by the function.
  • Return type: Number

Sample usage

number($100) returns 100.

number(string(base)) returns the original value of base.

Supported data types

Input type

Return type

Logic

Number

Number

If a Number value is passed, the same Number value will be returned.

Money

Number

If a Money value is passed, the amount will be returned as a Number.

Percent

Number

If a Percent value is passed, the amount will be returned as a Number of subtype Decimal where 50% is equivalent to .5.

Enum

Number

If a numeric scale Enum value is passed, the numeric value is returned as a Number.

Boolean

Number

If a Boolean value is passed, true will return the Number value 1, and false will return the Number value 0.

String

Number

If a String value is passed, its constituent characters will be evaluated for compatibility with the Number data type. Characters which are compatible will be returned as a Number value. If two or more sets of compatible characters are separated by non-compatible characters (ex. "121yes121"), the compatible sets of characters will be returned as comma-separated values (ex. 121,121)

Unsupported data types

Null

Unsupported data types return Null.

Updated 07 Dec 2021
Did this page help you?
Yes
No
UP NEXT
pluralize()
Docs powered by archbee 
TABLE OF CONTENTS
Syntax
Sample usage
Supported data types