[RFC PATCH] Warn about commas in floating point values?

Linus Torvalds torvalds at linux-foundation.org
Thu Mar 7 11:11:58 PST 2013


It might be a good idea to warn if we see a comma when we expect a
floating point value. We've had this locale issue several times. We
had it in our own native format long ago, but more commonly in imports
from other formats..

We potentially might also want to *parse* such numbers, just to be
even more permissive. If somebody writes "7,5kg", it's pretty obvious
what it means, but right now we will parse it as 7.

But that would be slightly more complicated to do, so here's a RFC
patch for just warning first.

Signed-off-by: LInus Torvalds <torvalds at linux-foundation.org>
---

Tested by intentionally corrupting one of my dives, it warned
properly. Of course, if you don't start subsurface from a terminal,
you'll never see the stderr warnings, which is part of why I suspect
we might just want to accept the European format..

Comments?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 520 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130307/8c78ac91/attachment.obj>


More information about the subsurface mailing list