ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum no longer accepts new user registrations, please report your question, problem and feedback to the issue page of ReoGrid on Github. Thanks for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-04-29 00:21:28

drdbkarron
Member
Registered: 2015-05-06
Posts: 29

Scientific notation number formats

If the cell interpreter determines an object is a number, is seems to default to a double. Sometimes an int.
It saves everything as an object. I guess.

I have doubles I am saving to a new sheet as the result of my calculation.
I want to format the numbers as scientific notation if I can't squeese the number into a few decimal places.

I would prefer calculate the display of the cell as a string and format it myself.
The underlying cell is a double. How do I get at fine control of the cell display for value based number display.
I may want to color the cell based on value, use fonts to display properties of the cell group, etc. etc.

I would like to put some fine subcontrols on the grid to display some statistics of the grid someplace, in the style of modern Excel.
Users expect the controls to have a hover help, and can I overload the build in context controls?

Offline

#2 2016-04-29 09:27:19

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Scientific notation number formats

1. Number format
You can set cell's data format to Text, that prevents ReoGrid core to detect and format cell data.

worksheet.SetRangeDataFormat("A1:B3", CellDataFormatFlag.Text);

Then you can put anything you want into the cell.
https://reogrid.net/document/data-format/

2. Overload built-in control
Yes you can.
Built-in controls: https://reogrid.net/document/built-in-cell-types/
Custom cell overview: https://reogrid.net/document/custom-cell/

A hover help may not available currently, because it requires a screen coordinate position that currently is not provided by ReoGrid.

Offline

#3 2016-04-29 10:50:35

drdbkarron
Member
Registered: 2015-05-06
Posts: 29

Re: Scientific notation number formats

Saving scientific notation as text requires a lot of bytes. Saving in binary requires two words, 64 bits.
I may use an arbitrary precision arithmetic package which saves numbers as text strings that can grow immense.

Offline

#4 2016-04-29 11:40:53

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Scientific notation number formats

If you set data format to Text, data type will not be changed, it saved as you putted. You give double, the double will be saved. You give string, the string will be saved.

Offline

#5 2016-04-29 14:37:06

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Scientific notation number formats

Or you could use customize data format: https://reogrid.net/document/custom-data-formatter/

We found that scientific notation format should be supported by ReoGrid, so we are planning to make it available from next release.

Offline

#6 2016-04-29 14:56:38

drdbkarron
Member
Registered: 2015-05-06
Posts: 29

Re: Scientific notation number formats

can you make the display formatting Interface so we can insert our own formatter?

Offline

Board footer

Powered by FluxBB