TypeTags .IntlNumberFormat

Overview

The Intl.NumberFormat object enables language-sensitive number formatting.

Usage

import { TypeTags } from 'typetags'
const japanese = new Intl.NumberFormat('ja-JP', {
style: 'currency',
currency: 'JPY',
})
TypeTags.IntlNumberFormat === TypeTags.get(japanese)
// → true
console.log(japanese.format(number))
// expected output: '¥123,457'

Predicate

.isIntlNumberFormat(value)

  • Checks if value is or has a default IntlNumberFormat type tag.
const { TypeTags } = require('typetags')
const formatter = new Intl.NumberFormat('en-GB')
TypeTags.isIntlNumberFormat(formatter)
// → true

Metadata (TType)

MetadataValue
.typeIntl.NumberFormat
.tag[object Intl.NumberFormat]
.builtin()undefined
.getTag()[object Intl.NumberFormat]
.hasSpecialArgs()false
.instance()undefined
.instanceTypeOf()object
.info()see more
.isAvailable()true
.isConstructor()true
.isFactory()true
.isFunction()true
.isGlobal()false
.isIterator()false
.isNested()true
.isObject()false
.isPrimitive()false
.isStringifiable()true
.isSyntatic()false
.isTypedArray()false
.ownKeys()[length, name, prototype, supportedLocalesOf]
.toString()function toString() { [native code] }
.typeOf()function

Signature

declare type ITypeTags = {
[key in Types | NestedTypes]: Tags
}
declare interface Predicate {
predicate(value: any): boolean
}

See MDN Web Docs