I have some data that I want to display as rationals.
someData={<|"utilization fraction" -> 1, "power fraction" -> 1|>, <|"utilization fraction" -> 7/8, "power fraction" -> 224/225|>, <|"utilization fraction" -> 3/4, "power fraction" -> 48/49|>, <|"utilization fraction" -> 5/8, "power fraction" -> 160/169|>, <|"utilization fraction" -> 1/2, "power fraction" -> 8/9|>, <|"utilization fraction" -> 3/8, "power fraction" -> 96/121|>, <|"utilization fraction" -> 1/4, "power fraction" -> 16/25|>, <|"utilization fraction" -> 1/8, "power fraction" -> 32/81|>}; Dataset[someData]
When I display this as a dataset, some of the entries are displayed as rationals and others are converted to decimals. The underlying data only has rational numbers so why do some get converted and how do I stop this?
I have tried various options on ItemSize in hopes that it would keep fractions but none are working. Is there some obscure option that will keep the entries as fractions?
For example,
Dataset[someData,ItemSize->{Full,3}]
doesn't change the view.
I am putting this into a report and my current (awful) solution is to redraw this as an Excel table and copy that.





Identity[]InputForm[]and#all yield what I wanted. Thanks to all for the suggestions! – Mark R Dec 29 '21 at 01:24bugstag. There is no apparent reason that the default formatting should switch every few rows without an explanation. Also I would request members to test it on various versions/platforms and add comments as necessary. – Syed Dec 29 '21 at 06:55