client.round
Round to nearest integer or specified decimal places
browsernot registered- Package
- @procedures/client · README
- Path
["client","round"]- CLI
- Not a
markcommand: it is not in the default registry. - As data
{"$proc":["client","round"],"input":{}}- Tags
- core, math
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY, allCoreProcedures } from "@procedures/client";
for (const procedure of allCoreProcedures) {
if (!PROCEDURE_REGISTRY.has(procedure.path)) PROCEDURE_REGISTRY.register(procedure);
}
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["client","round"], { value: 1 });
console.log(JSON.stringify(result));As data, in a program
{ "$proc": ["client", "round"], "input": { "value": 1 } }Input
| Field | Type | Required |
|---|---|---|
value | number | yes |
decimals | number | no |
Output
The schema does not list fields (number).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"value": {
"type": "number",
"description": "The value"
},
"decimals": {
"description": "The number of decimal places (default: 0)",
"type": "number"
}
},
"required": [
"value"
]
},
"output": {
"type": "number",
"description": "The value rounded to the nearest number"
}
}