diff --git a/docs/content/release_notes.md b/docs/content/release_notes.md index 82dd5ac..7c25cf9 100644 --- a/docs/content/release_notes.md +++ b/docs/content/release_notes.md @@ -1,5 +1,14 @@ # Release Notes +## 6.2.0 +**New Features** + +* Added the `UnitCode.roundToNearestTick` function. + +**Technical Enhancements** + +* Updated the [`@barchart/common-js`](https://github.com/barchart/common-js) library. + ## 6.1.1 **Bug Fixes** diff --git a/docs/content/sdk/lib-utilities-data.md b/docs/content/sdk/lib-utilities-data.md index b951abb..c17dff3 100644 --- a/docs/content/sdk/lib-utilities-data.md +++ b/docs/content/sdk/lib-utilities-data.md @@ -167,6 +167,7 @@ * [.getFractionDigits([special])](#UnitCodegetFractionDigits) ⇒ Number \| undefined * [.getMinimumTick(tickIncrement)](#UnitCodegetMinimumTick) ⇒ Number * [.getMinimumTickValue(tickIncrement, pointValue)](#UnitCodegetMinimumTickValue) ⇒ Number + * [.roundToNearestTick(value, tickIncrement, [roundToZero])](#UnitCoderoundToNearestTick) ⇒ Number * _static_ * [.parse(code)](#UnitCodeparse) ⇒ [UnitCode](#UnitCode) \| null * [.fromBaseCode(code)](#UnitCodefromBaseCode) ⇒ [UnitCode](#UnitCode) \| null @@ -315,6 +316,21 @@ | pointValue | Number |

Taken from a [Profile](/content/sdk/lib-marketstate?id=profile) instance.

| +* * * + +### unitCode.roundToNearestTick(value, tickIncrement, [roundToZero]) :id=unitcoderoundtonearesttick +> Rounds a value to the nearest valid tick. + +**Kind**: instance method of [UnitCode](#UnitCode) +**Returns**: Number + +| Param | Type | +| --- | --- | +| value | Number \| Decimal | +| tickIncrement | Number | +| [roundToZero] | Boolean | + + * * * ### UnitCode.parse(code) :id=unitcodeparse