OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

office-formula message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [office-formula] USDOLLAR



On Wednesday, 2007-03-21 15:04:05 -0500, David A. Wheeler wrote:

> Eike:
> > Excel has USDOLLAR, which, contrary to DOLLAR that is locale dependent,
> > always returns a string containing '$' as the currency symbol.
> > 
> > I propose to not define a function for one specific currency. Actually,
> > to display such fixed strings number formats can be used. Applications
> > that want to support the function should store it as
> > COM.MICROSOFT.USDOLLAR
> 
> Counter-proposal: I think we should keep it.

Counter-counter-proposal: it's nonsense ;-)

I actually made a serious error: I trusted the Ecma/Excel spec. That
says USDOLLAR would use the format  $#,##0.00;($#,##0.00)  whereas
DOLLAR explicitly specifies that different formats are used. I now
connected to some Windows servers, and both, Excel 2003 and Excel 2007,
treat USDOLLAR completely locale dependent. It seems USDOLLAR is just an
alias of DOLLAR, if there aren't subtle differences.

If it was locale-independent I'd consider it even more dangerous (see
.sig) in case applications automatically convert text to numbers.

Btw, in Excel, the (US)DOLLAR functions give nice opportunities to play
nasty if you switch to proper locales before reloading a carefully
crafted document. Left as an exercise to the reader ;-) 

  Eike

-- 
Automatic string conversions considered dangerous. They are the GOTO statements
of spreadsheets.  --Robert Weir on the OpenDocument formula subcommittee's list.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]