Re: Hyphen/dash instead of minus/negative for exponential numbers -
Douglas Brown
450 Posts
Thanks for reporting this, James. Yes it's true that Tracker uses hyphen-minus (u002D) because that is the default "minus" char used by Java NumberFormat classes. Since you solved the problem and nobody else has ever reported it, we will likely do nothing unless others report the same issue.
Oddly, when I googled this issue I found this post https://stackoverflow.com/questions/45630909/my-python-is-confusing-the-minus-with-dash-sign in which a python user had exactly the opposite problem--their python would not read the u2212 char, only the u002D. Here is the accepted solution in that post:
"It's not a Python problem, the float numbers that you are passing begin with minus signs (−, unicode U+2212) instead of regular hyphens-minus symbols (-, unicode U+002D, the ones used by Python and most languages as "minus" sign). I'd guess it's because you copied the numbers from some document, since it is rather hard to type a Unicode minus sign with a keyboard.
The easy solution is to replace these signs with regular hyphens when you call the program in the command line. If you really need you program to work with these signs, you could use a function like this to parse the numbers instead of calling float:
However I wouldn't recommend this, as it just complicates the program more and most command line tools that work with numbers do not support this, so users generally won't expect your program to do so."
Doug
> I had a problem reading my tracker data output with > python. I solved the problem > For eksampel > > 1,6E-04 > was formated with a dash/hyphen and not a negative > so python was reading it as a string that it could > not float.