new Decimal( [value] [, scale])
Metadata that treats topic values as Decimals. Accepts a default value, to be used by any topics added with this metadata.
Decimal topics may specify a particular scale of accuracy to use for values. If a default value is provided, the scale can be inferred from the the value unless ortherwise specified.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
value |
Number |
<optional> |
0 | The default value |
scale |
Number |
<optional> |
2 | The decimal scale |
Example
// Create a decimal metadata instance, with a default value of 3.141, limited to 3 decimal places. var mdecimal = new diffusion.metadata.Decimal(Math.PI, 3);