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

 


Help: OASIS Mailing Lists Help | MarkMail Help

office message

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


Subject: [OASIS Issue Tracker] Updated: (OFFICE-2641) Redefine ill-definedNUMBERVALUE



     [ http://tools.oasis-open.org/issues/browse/OFFICE-2641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eike Rathke updated OFFICE-2641:
--------------------------------

     Summary: Redefine ill-defined NUMBERVALUE  (was: [NEEDS-DISCUSSION] Redefine ill-defined NUMBERVALUE)
    Proposal: 
Remove any reference to date/time/currency.

Rewrite the regular expression as an example (see below).

If some non-digit character other than leading space characters or one leading sign character or trailing spaces is present, an error is generated. Except if given separator information as follows:

If the second parameter (optional decimal separator) is not given, only integer numbers are parsed.

Define a third optional parameter for the group separator. If not given, only
integer and decimal (if the second parameter is present) numbers are parsed.

Resulting in a syntax of:

NUMBERVALUE( Text T [ ; Text DecimalSeparator [ ; Text GroupSeparator ]] )

Constraints: LEN(DecimalSeparator) = 1, DecimalSeparator shall not appear in GroupSeparator

Semantics:

Replace
DecimalPoint defines the character used as the decimal point, either "." (period) or "," (comma).
with
DecimalSeparator defines the character used as the decimal separator, for example "." (period) or "," (comma). If this parameter is not given, only integer numbers are parsed.

Add:
GroupSeparator defines the character(s) used as grouping separator, for example "," (comma) or "." (period). If this parameter is not given, only integer or decimal numbers containing the DecimalSeparator are parsed. If this parameter is given, all characters contained are ignored in T if each is surrounded by a digit on each side. If GroupSeparator contains " " U+0020 (SPACE), U+0020 and U+00A0 (NO-BREAK SPACE) shall be equally treated.


Replace the regular expression with a sample regex for DecimalSeparator="." and GroupSeparator="," and Grouping="3":
[+|-]?([0-9]+(,[0-9])*)?(\.[0-9]+)?(([eE][+-]?[0-9]+)|%)?


Replace
If DecimalPoint is "," (a comma), use the expression above but swapping the comma for the period (so "." is ignored, and "," is the decimal point).
with
If, for example, DecimalSeparator is "," (a comma) and GroupSeparator is "."
(a period), use the expression above but swapping the comma for the period (so
"." is ignored).

Remove
"If the provided text does not match the pattern, an evaluator shall at least accept the same formats as VALUE does, and should accept the given DecimalPoint where appropriate (e.g., HH:MM:SS.sss or HH:MM:SS,sss depending on the DecimalPoint value)."
as this function is *not* a general purpose text to number converter.

Remove
"An evaluator may accept other formats as well, but these are implementation-defined."
as this function has a very specific purpose.

Adapt the Rationale offset note.


  was:
Remove any reference to date/time/currency.

Rewrite the regular expression as an example.

If some non-digit character other than leading space characters or one leading sign character or trailing spaces is present, an error is generated. Except if given separator information as follows:

If the second parameter (optional decimal separator) is not given, only integer numbers are parsed.

Define a third optional parameter for the group separator. If not given, only integer and decimal (as the second parameter is present) numbers are parsed.

An optional fourth parameter specifying grouping, defaulted to "3". Interpreted from right to left for possible grouping characteristics, for example "23" for Indic 1,00,00,000

Resulting in a syntax of:

NUMBERVALUE( Text T [ ; Text DecimalSeparator [ ; Text GroupSeparator [ ; Text Grouping = "3" ]]] )


Semantics:

Replace
DecimalPoint defines the character used as the decimal point, either "." (period) or "," (comma).
with
DecimalSeparator defines the character used as the decimal separator, for example "." (period) or "," (comma). If this parameter is not given, only integer numbers are parsed.

Add:
GroupSeparator defines the character used as the grouping separator, for example "," (comma) or "." (period). If this parameter is not given, only integer and decimal numbers containing a DecimalSeparator are parsed.

Grouping defines the grouping to be accepted, for example "3" for a grouping in thousands, or "23" for an Indic grouping. Defaults to "3".


Replace the regular expression with a sample regex for DecimalSeparator="." and GroupSeparator="," and Grouping="3":
[+|-]?([0-9]+(,[0-9]{3})*)?(\.[0-9]+)?(([eE][+-]?[0-9]+)|%)?


Replace
If DecimalPoint is "," (a comma), use the expression above but swapping the comma for the period (so "." is ignored, and "," is the decimal point).
with
If DecimalSeparator is for example "," (a comma), use the expression above but swapping the comma for the period (so "." is ignored, and "," is the decimal point).

Remove
If the provided text does not match the pattern, an evaluator shall at least accept the same formats as VALUE does, and should accept the given DecimalPoint where appropriate (e.g., HH:MM:SS.sss or HH:MM:SS,sss depending on the DecimalPoint value).
as this function is *not* a general purpose text to number converter.

Remove
An evaluator may accept other formats as well, but these are implementation-defined.
as this function has a very specific purpose.

Adapt the Rationale offset note.



Adapted proposal to latest comments.


> Redefine ill-defined NUMBERVALUE
> --------------------------------
>
>                 Key: OFFICE-2641
>                 URL: http://tools.oasis-open.org/issues/browse/OFFICE-2641
>             Project: OASIS Open Document Format for Office Applications (OpenDocument) TC
>          Issue Type: Improvement
>          Components: OpenFormula
>            Reporter: Eike Rathke
>            Assignee: Eike Rathke
>             Fix For: ODF 1.2 Part 2 CD 3
>
>
> The current definition of 5.13.28 NUMBERVALUE is not sufficient.
> Initial idea at http://lists.oasis-open.org/archives/office-formula/200901/msg00011.html
> See also http://lists.oasis-open.org/archives/office-formula/200703/msg00104.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


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