If we want to go this route, I'd still keep style as the primary attribute, and 
let currency only set the style if it isn't already set. So:

Old: {currency: "EUR"} => {style: "decimal"}
New: {currency: "EUR"} => {style: "currency", currency: "EUR"}
Unchanged:
- {} => {style: "decimal}
- {style: "decimal", currency: "EUR"} => {style: "decimal"}
- {style: "percent", currency: "EUR"} => {style: "percent"}
- {style: "currency", currency: "EUR"} => {style: "currency", currency: "EUR"}

It saves some typing, but makes the API a bit harder to explain. Comments?

Norbert



On Sep 4, 2012, at 10:21 , Nebojša Ćirić wrote:

> Or we could throw TypeError in that case (style not matching).
> 
> 
> 2012/9/4 Nebojša Ćirić <[email protected]>
> And {currency: 'USD', style:'percent'} would still produce {currency:'USD', 
> style: 'currency'}, i.e. currency property dictates the style?
> 
> 
> 
> 2012/9/4 Marcos Caceres <[email protected]>
> Hi,
> If I define a "currency" option for NumberFormat, then {style: "currency"} 
> should automagically be set, no?
> 
> I think is redundant to have to do the following:
>  {style: "currency", currency: "USD"}.
> 
> I should just be able to say: {currency: "USD"} without having to declare the 
> "style".
> 
> 
> --
> Marcos Caceres
> http://datadriven.com.au

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to