Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/math/index.ts>round

A JavaScript extension package for building strong and modern applications.
Latest
function round
import { round } from "https://deno.land/x/ayonli_jsext@v0.9.72/math/index.ts";

Returns the rounded value of the given number.

Examples

Example 1

import { round } from "@ayonli/jsext/math";

console.log(round(1.2345)); // 1
console.log(round(1.2345, 2)); // 1.23
console.log(round(1.2345, 3)); // 1.235

Parameters

value: number
optional
precision = [UNSUPPORTED]

Returns

number