Skip to content

Commit

Permalink
feat(ertp): add displayInfo.significantDecimals
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Nov 5, 2020
1 parent 2d1d425 commit c740a05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ERTP/src/displayInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const assertDisplayInfo = allegedDisplayInfo => {
if (allegedDisplayInfo === undefined) {
return;
}
const displayInfoKeys = harden(['decimalPlaces']);
const displayInfoKeys = harden(['decimalPlaces', 'significantDecimals']);
assertKeysAllowed(displayInfoKeys, allegedDisplayInfo);
};

Expand Down
4 changes: 4 additions & 0 deletions packages/ERTP/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
* should not be specified.
* The decimalPlaces property should be used for *display purposes only*. Any
* other use is an anti-pattern.
* @property {number=} significantDecimals
* Tells the display software how many decimal places should be conventionally
* shown. So, if `significantDecimals` is 2, and the rendered value according to
* `decimalPlaces` is '1.200', then this says to trim it to '1.20'.
*/

/**
Expand Down

0 comments on commit c740a05

Please sign in to comment.