rational.toString
This function gives the text `"n/d"`, or `"n"` for an integer. The text is exact.
CLI- Package
- @procedures/rational · README
- Path
["rational","toString"]- CLI
mark rational toString --a <object>- As data
{"$proc":["rational","toString"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/rational/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["rational","toString"], { a: {} });
console.log(JSON.stringify(result));From the command line
$ mark rational toString --a <object>
As data, in a program
{ "$proc": ["rational", "toString"], "input": { "a": {} } }Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
a | object | yes |
Output
The schema does not list fields (string).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"a": {
"type": "object",
"properties": {
"n": {
"type": "string",
"pattern": "^-?(0|[1-9][0-9]*)$",
"x-procedures-codec": "bigint"
},
"d": {
"type": "string",
"pattern": "^-?(0|[1-9][0-9]*)$",
"x-procedures-codec": "bigint"
}
},
"required": [
"n",
"d"
],
"additionalProperties": {}
}
},
"required": [
"a"
],
"additionalProperties": false
},
"output": {
"type": "string"
}
}