11

I'm trying to substitute TableForm with TableView because TableView is more handy with big data .

But on my Mathematica 9.0.1 (ubuntu 14.04_64bit) there is a problem with negative numbers:

aa = {{5.10, 1.2}, {-5.10, -1.2}}

aa // TableForm 

the last is fine but if I type

aa//TableView

the output of negative nuimbers is wrong (see attached immage) Negative numbers like -5.1 appears like -.51 !!!!

enter image description here

######## UPDATE 04.06.2014 @ 8.21 GMT

If you work with strings like that:

aa1 = {{"5.1", "1.2"}, {"-5.1", "-1.2"}}

TableView has no problem, look the picture:

enter image description here

msalese
  • 689
  • 3
  • 13
  • 2
    The same thing happens here (Mma 9.0.1 on Win32) – Dr. belisarius Jun 03 '14 at 13:17
  • .. same here (MMA 9.0.1.0, Windows 8 64bit) – kglr Jun 03 '14 at 13:19
  • 10
    Do not forget that TableView is undocumented and unsupported. Bad things may happen if you use it. (In practice: it may crash your front end and you'll lose unsaved changes, as well as the current kernel state. It happened to me.) – Szabolcs Jun 03 '14 at 14:40
  • 4
    @belisarius I do not agree with the bugs tag you added. I feel that that should only be apllied to MMA features that are part of the official corpus. – Sjoerd C. de Vries Jun 03 '14 at 14:44
  • Working like a charm on v8 Linux. Picture here – Öskå Jun 03 '14 at 14:49
  • 4
    @SjoerdC.deVries I think it may serve others to be aware that the misbehavior has been repro'ed. Of course you can't report this to WRI, but as this isn't an official site, the tag works more as a help/warn for other users than as a request/demand to fix the behavior. – Dr. belisarius Jun 03 '14 at 15:05
  • @SjoerdC.deVries Anyway, feel free to remove it if your comment gets some upvotes – Dr. belisarius Jun 03 '14 at 15:07
  • @belisarius It's a judgment call. I'll await the upvotes... – Sjoerd C. de Vries Jun 03 '14 at 15:29
  • @SjoerdC.deVries would a new tag (say bugs-undocumented) make any sense? I fear rather not... – Yves Klett Jun 03 '14 at 17:40
  • @SjoerdC.deVries Isn't it undocumented because they are still de bugging it? :P – mfvonh Jun 03 '14 at 18:01
  • 1
    @SjoerdC.deVries I'd appreciate you raising the question of using the bugs tag for undocumented functionality on Meta. – Mr.Wizard Jun 03 '14 at 21:12
  • 2
    @Yves In accordance with a past Meta question answered by R.M, which I'm too lazy to find, we are using double tagging, e.g. list-manipulation and filtering rather than list-filtering, so I have added undocumented as appropriate. – Mr.Wizard Jun 03 '14 at 21:14
  • 3
    @Öskå in V8 TableView was made of boxes such as GridBox. In V9 it was reinvented with its own TableViewBox. So the V8 and V9 versions are completely different beasts. – Mike Honeychurch Jun 03 '14 at 22:18
  • 2
    You can goad it into "working" with actual numbers instead of strings with something like Map[N[Rationalize[#], 3] &, aa, {2}] // TableView, perhaps replacing the 3 with something that sniffs at actual digits to determine how many to use... – ciao Jun 04 '14 at 08:09
  • @rasher, it works... just using N[Rationalize[aa], 5] // TableView, Thanks – msalese Jun 04 '14 at 09:10
  • 1
    same problem in 10.0.2 – Nasser Dec 11 '14 at 01:15

1 Answers1

2

It's clearly a bug, of course. You may also check the following "reformatting" weird behavior: If after executing TableView you "reexecute" the output, the negative numbers get their correct formatting:

enter image description here

as mentioned in the comments above it looks like a ToBoxes bugged implementations for negative numbers. Any of the following work OK:

a1 = Map[ToBoxes, aa, {2}]
a2 = Map[ToString, aa, {2}]
a3 = Map[SetPrecision[#, 3] &, aa, {2}]
TableView /@ {aa, a1, a2, a3}
Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453