In <number:fraction> element, Gnumeric treats both attributes min-denominator-digits and max-denominator-digits (see bug 38097#c27), while LibO knows only min-denominator-digits like ODF 1.2 standard:
ODF 1.3 will include max-denominator-digits:
LibO should now also treats this attribute. As actual LibO treats "min-denominator-digits" as the maximum of denominator digits, backward compatibility should carefully checked.
IMHO, when importing:
- if both attributes (min and max-denominator-digits) are present, treat them normally (it would be great also to import gnm:max-denominator-digits as number:max-denominator-digits)
- if only min-denominator-digits is present, consider it as max-denominator-digits and set min-denominator-digits to 0
- format string should be build with n_q number of '?' and n_z number of '0', with n_z = min-denominator-digits and n_q = max-denominator-digits - min-denominator-digits
Main issue will be when exporting. As min-denominator-digits="0" is not recognized (see bug 38097#c27) with actual version of LibO, fraction format will be lost if file is opened with actual or previous version. This should be exported to specifically ODF 1.3
We could backport the importing part to 5-1 and 5-2 so at least the fraction format will not be lost when importing such file.
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":
tdf#99661 Add max-denominator-value attribute to number:fraction
It will be available in 5.3.0.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.