Skip to content

ScientificNotationNode

Overview

ScientificNotationNode displays a number in scientific notation, M x 10^E, where: - M is the mantissa - E is the exponent, a positive or negative integer

For example, with 2 decimal places in the mantissa, 0.0002342 would be written as 2.34 x 10^-4.

@author Chris Malley (PixelZoom, Inc.)

Class ScientificNotationNode

import { ScientificNotationNode } from 'scenerystack/scenery-phet';

Constructor

new ScientificNotationNode( valueProperty : TReadOnlyProperty<number | null>, providedOptions? : ScientificNotationNodeOptions )

Instance Methods

dispose()

Instance Properties

valueProperty : TReadOnlyProperty<number | null>

(readonly)

Static Methods

toScientificNotation( value : number, providedOptions? : ToScientificNotationOptions ) : ScientificNotation

Converts a number to scientific-notation format: M x 10^E, with mantissa M and exponent E.

Type ScientificNotation

return type of toScientificNotation

import type { ScientificNotation } from 'scenerystack/scenery-phet';
  • mantissa: string
  • exponent: string

Type ScientificNotationNodeOptions

import type { ScientificNotationNodeOptions } from 'scenerystack/scenery-phet';
  • fill?: TColor
  • font?: Font
  • exponent?: number | null
  • mantissaDecimalPlaces?: number
  • exponentScale?: number
  • showIntegersAsMantissaOnly?: boolean
  • showZeroAsInteger?: boolean
  • showZeroExponent?: boolean
  • exponentXSpacing?: number
  • exponentYOffset?: number
  • capHeightScale?: number
  • nullValueString?: string
  • & StrictOmit<NodeOptions, "children">

Type ToScientificNotationOptions

options for toScientificNotation

import type { ToScientificNotationOptions } from 'scenerystack/scenery-phet';

Pick<ScientificNotationNodeOptions, "mantissaDecimalPlaces" | "exponent">

Source Code

See the source for ScientificNotationNode.ts in the scenery-phet repository.