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

x/ddc_vim/deps.ts>fn.round

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.round
import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { round } = fn;

Round off {expr} to the nearest integral value and return it as a Float. If {expr} lies halfway between two integral values, then use the larger one (away from zero). {expr} must evaluate to a Float or a Number. Returns 0.0 if {expr} is not a Float or a Number. Examples:

echo round(0.456)

    0.0

echo round(4.5)

    5.0

echo round(-4.5)

    -5.0

Can also be used as a method:

Compute()->round()

Parameters

denops: Denops
expr: unknown

Returns

Promise<number>