Fix/data viewer display - #1738
Conversation
eitsupi
left a comment
There was a problem hiding this comment.
Could we also add a regression test for an S4 numeric subclass?
The new synthetic class test is S3, whereas lubridate::Period is an S4 class extending numeric, which is the exact shape that previously fell into the numeric-column branch.
A minimal synthetic S4 class would test the new is.object() behavior without adding lubridate as a dependency.
I will add a test for that. But the fix should be general for numeric values with an arbitrary class, which is based on both |
Closes #1463
Closes #1408
The fix disables JSON's default decimal rounding for all numeric values. AG Grid continues to use JS default formatting, which switches to scientific notation below 1e-6.
1.54e-5would appear as0.0000154in the data viewer instead of 0.1.54e-7would appear as1.54e-7in the data viewer.The fix adds one shared formatting function that calls R's
format()generic to use each class's formatting method when displaying its values. If a class does not implement aformat.xxx()method, R usesformat.default()by default.