Skip to main content

Interface: DecimalNumberOptions

Defined in: src/mobjects/text/DecimalNumber.ts:20

Options for creating a DecimalNumber mobject

Properties​

color?​

optional color: string

Defined in: src/mobjects/text/DecimalNumber.ts:38

Text color as CSS color string. Default: '#ffffff'


edgeToFix?​

optional edgeToFix: "left" | "right"

Defined in: src/mobjects/text/DecimalNumber.ts:42

Edge to preserve when number width changes. Default: null (center)


fillOpacity?​

optional fillOpacity: number

Defined in: src/mobjects/text/DecimalNumber.ts:40

Fill opacity from 0 to 1. Default: 1


fontFamily?​

optional fontFamily: string

Defined in: src/mobjects/text/DecimalNumber.ts:34

Font family. Default: 'monospace'


fontSize?​

optional fontSize: number

Defined in: src/mobjects/text/DecimalNumber.ts:32

Font size in pixels. Default: 48


fontWeight?​

optional fontWeight: string | number

Defined in: src/mobjects/text/DecimalNumber.ts:36

Font weight. Default: 'normal'


groupWithCommas?​

optional groupWithCommas: boolean

Defined in: src/mobjects/text/DecimalNumber.ts:30

Group digits with separator (e.g., 1,000). Default: false


includeSign?​

optional includeSign: boolean

Defined in: src/mobjects/text/DecimalNumber.ts:28

Whether to show + sign for positive numbers. Default: false


numDecimalPlaces?​

optional numDecimalPlaces: number

Defined in: src/mobjects/text/DecimalNumber.ts:24

Number of decimal places to show. Default: 2


showEllipsis?​

optional showEllipsis: boolean

Defined in: src/mobjects/text/DecimalNumber.ts:26

Whether to show ellipsis (...) after the number. Default: false


unit?​

optional unit: string

Defined in: src/mobjects/text/DecimalNumber.ts:44

Unit string to append (e.g., '%', 'm/s'). Default: ''


unitBuff?​

optional unitBuff: number

Defined in: src/mobjects/text/DecimalNumber.ts:46

Buffer between number and unit. Default: 0.05


value?​

optional value: number

Defined in: src/mobjects/text/DecimalNumber.ts:22

The numeric value to display. Default: 0