easy-api.ts
Version:
A powerful library to create your own API with ease.
1 lines • 772 B
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0});let APIFunction_1=require("../../classes/structures/APIFunction"),Error_1=require("../../classes/structures/Error"),Util_1=require("../../classes/internal/Util");class Round extends APIFunction_1.APIFunction{name="$round";description="Returns a supplied numeric expression rounded to the nearest integer.";parameters=[{name:"Value",description:"The value to be rounded to the nearest integer.",type:APIFunction_1.ParamType.Number,required:!0,rest:!1,defaultValue:null}];usage="$tan[number]";returns=APIFunction_1.ParamType.Number;aliases=[];compile=!0;async run(e,[r]){if(Util_1.Util.isNumber(r))return Math.round(Number(r)).toString();throw new Error_1.InvalidFieldIndex(r,e.function,"Value")}}exports.default=Round;