---
title: "Number"
description: "Number operations for arithmetic, formatting, validation, and helpers."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/data-ops/number"
---
# Number

> Number operations for arithmetic, formatting, validation, and helpers.

<block-meta block="Yes" channels="Any" folder="basic/data-ops" group="Data Operations" groupTo="/build/workflows/blocks/data-ops" icon="i-lucide-hash" pipe="Value" scope="Any" tool="No" type="data-ops.number">



</block-meta>

**Number** (canvas label **Number ·** plus the operation) runs one numeric **Operation** and writes the result to the data pipe. Invalid numbers (divide by zero, empty list for average, and similar) fail the block.

For a single formula such as `(2 + 3) * 5`, [Evaluate Math](https://docs.vettero.com/build/workflows/blocks/utility/evaluate-math) is often enough. Use this block for rounding, currency, random integers, and list statistics.

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Operation
      </strong>
    </td>
    
    <td>
      Grouped list. Changing it resets the other fields
    </td>
  </tr>
  
  <tr>
    <td>
      Remaining fields
    </td>
    
    <td>
      Depend on <strong>
        Operation
      </strong>
      
       (for example <strong>
        A
      </strong>
      
      , <strong>
        B
      </strong>
      
      , <strong>
        Number
      </strong>
      
      , <strong>
        Array
      </strong>
      
      )
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues after the operation
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`). The type depends on **Operation**: number, true/false, or text (conversion and formatting).

## Operations

### Core

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Create
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Value
      </strong>
      
       — convert to number
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Is valid
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        Value
      </strong>
      
       — converts and is not NaN
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Is finite
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        Number
      </strong>
    </td>
  </tr>
</tbody>
</table>

### Arithmetic

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Add
      </strong>
      
       / <strong>
        Subtract
      </strong>
      
       / <strong>
        Multiply
      </strong>
      
       / <strong>
        Divide
      </strong>
      
       / <strong>
        Mod
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        A
      </strong>
      
      , <strong>
        B
      </strong>
      
       — divide and mod fail when <strong>
        B
      </strong>
      
       is <code>
        0
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Power
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Base
      </strong>
      
      , <strong>
        Exponent
      </strong>
    </td>
  </tr>
</tbody>
</table>

### Rounding

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Round
      </strong>
      
       / <strong>
        Floor
      </strong>
      
       / <strong>
        Ceil
      </strong>
      
       / <strong>
        Trunc
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Number
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Round to decimals
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Decimals
      </strong>
      
       (integer 0–100)
    </td>
  </tr>
</tbody>
</table>

### Comparison and range

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Equals
      </strong>
      
       / <strong>
        Greater than
      </strong>
      
       / <strong>
        Greater or equal
      </strong>
      
       / <strong>
        Less than
      </strong>
      
       / <strong>
        Less or equal
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        A
      </strong>
      
      , <strong>
        B
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Min
      </strong>
      
       / <strong>
        Max
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Numbers
      </strong>
      
       (list, at least one)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Clamp
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Min
      </strong>
      
      , <strong>
        Max
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        In range
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Min
      </strong>
      
      , <strong>
        Max
      </strong>
      
       — inclusive
    </td>
  </tr>
</tbody>
</table>

### Math helpers and random

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Abs
      </strong>
      
       / <strong>
        Sqrt
      </strong>
      
       / <strong>
        Cbrt
      </strong>
      
       / <strong>
        Log
      </strong>
      
       / <strong>
        Log10
      </strong>
      
       / <strong>
        Exp
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
       — sqrt needs ≥ 0; log needs > 0
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Random
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      None — in <code>
        [0, 1)
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Random int
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Min
      </strong>
      
      , <strong>
        Max
      </strong>
      
       — inclusive integers
    </td>
  </tr>
</tbody>
</table>

### Conversion and formatting

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        To string
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Number
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        To fixed
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Digits
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        To precision
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Precision
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Format
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , optional <strong>
        Locale
      </strong>
      
      , optional <strong>
        Intl options
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Currency
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Currency code
      </strong>
      
       (3-letter ISO, for example <code>
        USD
      </code>
      
      ), optional <strong>
        Locale
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Percentage
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , optional <strong>
        Decimals
      </strong>
      
       — value <code>
        0.5
      </code>
      
       becomes <code>
        50.00%
      </code>
    </td>
  </tr>
</tbody>
</table>

### Validation

Each takes **Number** and returns true/false: **Is integer**, **Is float**, **Is even**, **Is odd**, **Is positive**, **Is negative**.

### List stats and interpolation

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Sum
      </strong>
      
       / <strong>
        Average
      </strong>
      
       / <strong>
        Median
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Array
      </strong>
      
       of numbers
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Percentile
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Array
      </strong>
      
      , <strong>
        Percentile (0-100)
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Normalize
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        Number
      </strong>
      
      , <strong>
        Min
      </strong>
      
      , <strong>
        Max
      </strong>
      
       — scale to 0–1
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Lerp
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        A
      </strong>
      
      , <strong>
        B
      </strong>
      
      , <strong>
        T (0-1)
      </strong>
      
       — linear interpolation
    </td>
  </tr>
</tbody>
</table>

### Constants

No extra fields. Result is a number: **PI**, **E**, **MAX_SAFE**, **MIN_SAFE**.

## Use case

- **Multiply** quantity × price, then **Currency** for a message.
- **Round to decimals** before writing a table number field.
- **Sum** a list of amounts from [Table Find](https://docs.vettero.com/build/workflows/blocks/table/find).

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
