##// END OF EJS Templates
Added tag v1.0.0-rc11 for changeset 9b77ac3bf8f2
Added tag v1.0.0-rc11 for changeset 9b77ac3bf8f2

File last commit:

r2:8ec37bf1b4d1 default
r25:02ffb530b1a9 default
Show More
currency.d.ts
76 lines | 2.5 KiB | video/mp2t | TypeScriptLexer
cin
created typings for basic part of dojo and dijit further work is required to...
r2 import { NumberFormatOptions, NumberParseOptions, NumberRegexpOptions } from "./number";
export interface CurrencyFormatOptions extends NumberFormatOptions {
/**
* Should not be set. Value is assumed to be "currency".
*/
type?: string;
/**
* localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
* A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
*/
symbol?: string;
/**
* an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
* For use with dojo.currency only.
*/
currency?: string;
/**
* number of decimal places to show. Default is defined based on which currency is used.
*/
places?: number;
}
export interface CurrencyParseOptions extends NumberParseOptions {
/**
* Should not be set. Value is assumed to be "currency".
*/
type?: string;
/**
* localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
* A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
*/
symbol?: string;
/**
* an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
* For use with dojo.currency only.
*/
currency?: string;
/**
* number of decimal places to show. Default is defined based on which currency is used.
*/
places?: number;
/**
* Whether to include the fractional portion, where the number of decimal places are implied by the currency
* or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
* By default for currencies, it the fractional portion is optional.
*/
factional?: boolean | [boolean, boolean];
}
export declare function _mixInDefaults(options: NumberFormatOptions): CurrencyFormatOptions;
/**
* Format a Number as a currency, using locale-specific settings
*/
export declare function format(value: number, options?: CurrencyFormatOptions): string;
/**
* Builds the regular needed to parse a currency value
*/
export declare function regexp(options?: NumberRegexpOptions): string;
/**
* Convert a properly formatted currency string to a primitive Number,
* using locale-specific settings.
*/
export declare function parse(expression: string, options?: CurrencyParseOptions): number;