#249 Merged at ab8bb90
  1. Ed McDonagh
  • Added filter snippet to set significant figures. From but edited to deal with "0E-12" and to return a Decimal that can be localised. Refs #693
  • Updating sigdig to work with negative numbers as pointed out by @dplatten. Thanks! refs #693
  • Better handling of zero, works for negative numbers. Refs #693
  • Added ref #693 to changes. [skip ci] docs only

Comments (6)

  1. Ed McDonagh author

    If anyone wants to try this, apart from checking out the code you only need to change the language code in - I think it will only affect the interface display.

  2. Luuk

    @edmcdonagh , it looks fine, except that None values are not handled correctly (resulting in runtime errors).

    I think the first lines of sigdig should be:

        if value is None:
            return None

    (I only tested the interface, no rdsr-import tested)

  3. Ed McDonagh author

    Thanks Luuk - I have modified it to not return anything if None, which (locally) sorts out the test failure, hopefully the pipeline too.

    Can you test again please?

  4. Luuk

    Hi Ed, It is working fine now.

    Just to nitpick😉, it seems "floatformat" returns an empty string if the value is None. So the columns using floatformat don't show a value and the columns using sigdig show ‘None’ (see last 2 colums in screenshot below):

    To make behaviour consistent, an empty string should be returned if value is None (already tested and it works). Up to you if you want to implement that!

  5. Ed McDonagh author

    I’m happy with this now @LuukO now that sigdigreturns '' if None is passed. Have you been able to check it?