Fix getYTicksByIndex truncating integers by using toFixed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -76,11 +76,7 @@ const getTimeUnitAndValueToUse = (secondToDecide) => {
|
||||
* @returns {string} The formatted tick label (e.g. "2.5h").
|
||||
*/
|
||||
export function getYTicksByIndex(stepSize, index, unitToUse) {
|
||||
const rawStepsizeMultIndex = (stepSize * index).toString();
|
||||
const shortenStepsizeMultIndex = rawStepsizeMultIndex.substring(
|
||||
0,
|
||||
rawStepsizeMultIndex.indexOf(".") + 1 + TOFIXED_DECIMAL,
|
||||
);
|
||||
const shortenStepsizeMultIndex = (stepSize * index).toFixed(TOFIXED_DECIMAL);
|
||||
return `${shortenStepsizeMultIndex}${unitToUse}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user