Add a format parameter to the Decimal type
A user on DokuWiki Forum need a special format for numbers. https://forum.dokuwiki.org/d/22218-how-to-force-leading-zeroes-when-using-a-bureacuracy-form-with-struct
This add a new config parameter for the Decimal type: format
If format is set and valid all other formatting parameters(roundto, decpoint, thousands, trimzeros, engineering) are ignored.
format must be a valid format for sprintf and accepts the following number formats: bdeEfFu
LGTM. Can you fix the code sniffer issue and squash your commits?
I hope that was all correct. My first question: What is squashing? 🙈 I think it worked.
Great. One more thing: can you please extend the unit tests to cover your new setting? See https://github.com/cosmocode/dokuwiki-plugin-struct/blob/master/_test/types/DecimalTest.php
OK, test failed: There was 1 failure:
1) dokuwiki\plugin\struct\test\types\DecimalTest::test_renderValue with data set #43 ('1', '1 ', '-1', '.', ' ', true, '', '', false, '%u')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1 '
+'1'
I will fix that.
The commit message is now total crap. Unfortunately, I have no idea whether it can still be changed...
The commit message is now total crap. Unfortunately, I have no idea whether it can still be changed...
You can do a git commit --amend it lets you edit the last commit. Once done, do another force push.