senaite.core icon indicating copy to clipboard operation
senaite.core copied to clipboard

String results formatted as numbers

Open grulisco opened this issue 4 years ago • 0 comments

Description

The feature of handling string results in analyses was introduced with https://github.com/senaite/senaite.core/pull/1401 happily.

For analysis services configured as string results senaite behaves confusing, because in some situations results are converted to formatted numerical results, when it actually should not.

Sometimes string results contain only numbers but aren't meant as numerical values.

We also use this feature to express values over huge ranges or special information correctly, e.g.

  • 123
  • 1.23
  • 0.0123
  • < 1000
  • not detected

Reproduction guide

  • Set up AS with option String result
  • Create sample with this AS
  • Enter and submit results containing numbers in different ways (see screenshot)

Observed behaviour

There are some different observed cases for entered results:

  1. long decimal value with german decimal character , -> handled as string as expected, because , is not a part of numericals in python supposedly

  2. same long decimal value with decimal point . -> handled as a formatted number (here with 1 decimal)

  3. value with prefix < -> handled as formatted number without <

Expected behaviour

String results shall be handled exactly as entered - IMO that's the purpose of this feature.

No numerical formatting rules (decimals, detection limits) shall override the string content - it should be the other way round: String results shall override formatting.

Versions

  • OS: Linux

  • senaite.core: 1.3.x

  • senaite.impress: 1.x

  • senaite.core.listing: 1.x

  • senaite.core.supermodel: 1.x

Screenshot

image

grulisco avatar Aug 26 '20 15:08 grulisco