import type Decimal from "break_infinity.js" ; import { AbstractInfixNotation } from "./infix-abstract" ; import { toSubscript , abbreviate } from "../utils" ; export class InfixLongScaleNotation extends AbstractInfixNotation { public readonly name = "Infix long scale" ; protected groupDigits = 6 ; protected canHandleZeroExponent = false ; public formatDecimal ( value , places ) { return this . formatInfix ( value , places ) . replace ( /[,.]/g , ( x ) => x === "." ? "," : "." ) ; } public formatNegativeDecimal ( value , places ) { return `₋${ this . formatDecimal ( value , places ) }` ; } protected formatMantissa ( digit ) { return toSubscript ( digit ) ; } protected formatExponent ( exp ) { if ( exp < 0 ) { return ( exp / 6 ) . toString ( ) ; } return abbreviate ( Math . floor ( exp / 6 ) ) ; } }