import type Decimal from "break_infinity.js" ; import { AbstractInfixNotation } from "./infix-abstract" ; import { toSubscript , abbreviate } from "../utils" ; export class InfixShortScaleNotation extends AbstractInfixNotation { public readonly name : string = "Infix short scale" ; protected canHandleZeroExponent = false ; public formatNegativeDecimal ( value , places ) { return `₋${ this . formatDecimal ( value , places ) }` ; } protected formatMantissa ( digit ) { return toSubscript ( digit ) ; } protected formatExponent ( exp ) { if ( exp < 0 ) { return ( exp / 3 ) . toString ( ) ; } return abbreviate ( exp / 3 - 1 ) ; } }