UnitConverter Class

Contains methods to convert different units of measurement.

Declaration

export class UnitConverter

Methods

centimetersToTwips(value) Method

Converts a measurement from centimeters to twips.

Declaration

centimetersToTwips(value: number): number

Parameters

Name Type Description
value number

The value in centimeters to convert.

Returns

Type Description
number

The value in twips.

inchesToTwips(value) Method

Converts a measurement from inches to twips.

Declaration

inchesToTwips(value: number): number

Parameters

Name Type Description
value number

The value in inches (floating) to convert.

Returns

Type Description
number

The value in twips.

pixelsToCentimeters(value) Method

Converts a measurement from pixels to centimeters.

Declaration

pixelsToCentimeters(value: number): number

Parameters

Name Type Description
value number

The value in pixels to convert.

Returns

Type Description
number

The value in centimeters.

pixelsToInches(value) Method

Converts a measurement from pixels to inches.

Declaration

pixelsToInches(value: number): number

Parameters

Name Type Description
value number

The value in pixels to convert.

Returns

Type Description
number

The value in inches.

pixelsToPoints(value) Method

Converts a measurement from pixels to points.

Declaration

pixelsToPoints(value: number): number

Parameters

Name Type Description
value number

The value in pixels to convert.

Returns

Type Description
number

The value in points.

pixelsToTwips(value) Method

Converts a measurement from pixels to twips.

Declaration

pixelsToTwips(value: number): number

Parameters

Name Type Description
value number

The value in pixels to convert.

Returns

Type Description
number

The value in twips.

pointsToTwips(value) Method

Converts a measurement from points to twips.

Declaration

pointsToTwips(value: number): number

Parameters

Name Type Description
value number

The value in points to convert.

Returns

Type Description
number

The value in twips.

twipsToCentimeters(value) Method

Converts a measurement from twips to centimeters.

Declaration

twipsToCentimeters(value: number): number

Parameters

Name Type Description
value number

The value in twips to convert.

Returns

Type Description
number

The value in centimeters.

twipsToInches(value) Method

Converts a measurement from twips to inches.

Declaration

twipsToInches(value: number): number

Parameters

Name Type Description
value number

The value in twips to convert.

Returns

Type Description
number

The value in inches.

twipsToPoints(value) Method

Converts a measurement from twips to points.

Declaration

twipsToPoints(value: number): number

Parameters

Name Type Description
value number

The value in twips to convert.

Returns

Type Description
number

The value in points.