Skip to main content

Interface: DecimalNumberOptions

Defined in: mobjects/text/DecimalNumber.ts:15

Options for creating a DecimalNumber mobject

Properties

color?

optional color: string

Defined in: mobjects/text/DecimalNumber.ts:33

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


edgeToFix?

optional edgeToFix: "left" | "right"

Defined in: mobjects/text/DecimalNumber.ts:37

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


fillOpacity?

optional fillOpacity: number

Defined in: mobjects/text/DecimalNumber.ts:35

Fill opacity from 0 to 1. Default: 1


fontFamily?

optional fontFamily: string

Defined in: mobjects/text/DecimalNumber.ts:29

Font family. Default: 'monospace'


fontSize?

optional fontSize: number

Defined in: mobjects/text/DecimalNumber.ts:27

Font size in pixels. Default: 48


fontWeight?

optional fontWeight: string | number

Defined in: mobjects/text/DecimalNumber.ts:31

Font weight. Default: 'normal'


groupWithCommas?

optional groupWithCommas: boolean

Defined in: mobjects/text/DecimalNumber.ts:25

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


includeSign?

optional includeSign: boolean

Defined in: mobjects/text/DecimalNumber.ts:23

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


numDecimalPlaces?

optional numDecimalPlaces: number

Defined in: mobjects/text/DecimalNumber.ts:19

Number of decimal places to show. Default: 2


showEllipsis?

optional showEllipsis: boolean

Defined in: mobjects/text/DecimalNumber.ts:21

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


unit?

optional unit: string

Defined in: mobjects/text/DecimalNumber.ts:39

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


unitBuff?

optional unitBuff: number

Defined in: mobjects/text/DecimalNumber.ts:41

Buffer between number and unit. Default: 0.05


value?

optional value: number

Defined in: mobjects/text/DecimalNumber.ts:17

The numeric value to display. Default: 0