Fix bug in subsurface XML to DivelogsDE XML export parsing.#4747
Fix bug in subsurface XML to DivelogsDE XML export parsing.#4747mikeller merged 1 commit intosubsurface:masterfrom
Conversation
When calculating the volume of tanks with fractional values, the division in the XSLT template causes a comma to be used as the decimal separator instead of a period. This is fixed by explicitly converting the result with a known format string. Signed-off-by: Victor Arvidsson <[email protected]>
|
Artifacts: |
|
Artifacts: |
|
Artifacts: |
|
Artifacts: |
|
Guessing this was locale dependant, and this was ever only tested in locales which use . as decimal separator. LGTM |
mikeller
left a comment
There was a problem hiding this comment.
Good find.
There are other places in this template where we are returning fractional numbers, that may or may not cause errors when importing in DivelogsDE.
I think it will be a better approach to set the global format for fractional numbers at the top of the file with
<xsl:decimal-format decimal-separator="."/>
From what I've found, the Also, I think this is the only place in the template where the value is actually converted to a number, the other values are substrings, and are treated as string throughout the transformation. |
When calculating the volume of tanks with fractional values, the division in the XSLT template causes a comma to be used as the decimal separator instead of a period.
This is fixed by explicitly converting the result with a known format string.
Describe the pull request:
Pull request long description:
Changes made:
Related issues:
Additional information:
Documentation change:
Mentions: