Experiment Web
CaroPikachuBlogProcess

Documentation

  • Getting started
  • Round
  • Compact
  • IO
  • Notation
  • Format
  • Types
  1. Blog

  2. Format number

  3. round

function round(value: NumberType, options: RoundingConfigType = {}): string

Rounds a number based on the specified precision and rounding mode.

Params

  • value (NumberType): The value to be rounded. Can be a number, string, or bigint.
  • options (RoundingConfigType): Configuration for rounding.

Returns

(string): The rounded number as a string.

Example

value
mode
precision

round(0);

Result: 0