-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intl / l10n / number formatting #21
Comments
Hi, |
Ok, this is the template with automatic sub-blocks and one column with ope=tbs:percent, but without adding the percent-formatting in the document: An example data-set would be (stripped down to one row, the sub-block stuff is working):
The data is also available in a simple OpenTBS command line app under https://github.com/rotdrop/opentbs-tool in the examples/ subdir. The data is merged by replacing the data-source array of TBS with the given data and doing a block merge with the key 'outer' like It works so far, the "percentage" numbers are then output as numbers in US or "C" notation with a dot as decimal divider-char. The output with a slightly more complicated data-set with more than on row is as follows: template-sub-tables-opentbs-6dc0b337567915e0f670152d55bbe71c.odt Here the document language is in principle German. The number is displayed without percent and with a decimal dot. Looking at the numer-format of the substituted document shows the table cell as "text" with "@" format character. If I now start to format table cells as percent in LibreOffice things start to become complicated:
Internationalization would really be nice as office-documents tend to be exchanged between non-nerds. BTW: what would be the expected result? Should ope=tbe:percent ouput a percentage sign behind the number? And should the field type in the substituted document be adjusted to a numerical type? I suppose I will now go and read a little bit more of the documentation; perhaps there is already something built-in to achieve what I want here. |
Ok, so adding frm='0,000 %' seems to work. Then may I ask what actually "ope=tbs:percent" is doing? I get the desired result without it, by only specifying the format, and ope=tbs:percent alone does not hack it. It would be nice if the default number formatting could somehow be styled according to the document language, instead of using the C locale by default. Thank you for your work! I think using the format-options I get what I want to some extend. |
The format Is this comma vs. dot feature somewhere documented? Is it even supported, or do I get the correct result by chance? Kind thanks Claus |
Is there any support for number locales different from EN/US? I know I can tell OpenTBS with e.g. ope=tbs:percent (or curr, etc.) that field is numeric. However, the number itself does not seem to be converted to the documents language.
Maybe related: if I format a cell in the template as percentage, the value will be displayed as zero after merging. In the XML I find something like this:
So it seems that LibreOffice remembers the invalid number from the template, resulting from the TBS template field in square brackets. Also, if using e.g. German then we have a comma as decimal separator and a point to separate thousands, e.g. US 1,000.56 is 1.000,56 in German and a couple of other languages.
Is there any experience with OpenTBS in the context of non-US English?
Kind thanks for any hints!
The text was updated successfully, but these errors were encountered: