Skip to content

Locale can flip what the , and . operators mean #23

@borgar

Description

@borgar

This is the content of a workbook file with both versions of the formula, saved under the German locale:

<sheetData>
  <row>
    <c r="A1" t="str">
      <f>TEXT(0, "#.##0,00")</f>
      <v>0,00</v>
    </c>
  </row>
  <row>
    <c r="A2" t="str">
      <f>TEXT(0, "#,##0.00")</f>
      <v>,000</v>
    </c>
  </row>
</sheetData>

What is needed to support this is an option to parse/treat the separators according to the locale:

numfmt("#.##0,00", { locale: "de", localeParse: true })(0) // 0,00
numfmt("#,##0.00", { locale: "de", localeParse: true })(0) // ,000
numfmt("#.##0,00", { locale: "de", localeParse: false })(0) // ,000
numfmt("#,##0.00", { locale: "de", localeParse: false })(0) // ,000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions