Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting is limited in Formula Columns #54

Closed
aarondr77 opened this issue Feb 8, 2022 · 5 comments · Fixed by #75
Closed

Formatting is limited in Formula Columns #54

aarondr77 opened this issue Feb 8, 2022 · 5 comments · Fixed by #75
Labels
type: mitosheet Changes the mitosheet package

Comments

@aarondr77
Copy link
Member

Describe the bug
The potential format options for a number series is dependent on whether the column is a float or an int. For most of the format options this isn't an issue. For example, the Accounting format option treats both floats and ints in the same manner. However, for the default and plain text formatting options, floats and ints are treated differently. Specifically, in the plain text and default formatting option, a float has a trailing .0 and an int does not.

In a data column, its easy to convert the dtype from float to int in order to get rid of the trailing .0. But there is no way to convert a formula column from a float to an int. The only dtype manipulation available is to use the value formula which converts a series to a number series.

To Reproduce

  1. Create a dataframe in Mito that has a column, Date, that is a datetime series.
  2. Create a new column, Year, and use the formula =YEAR(Date)
  3. Notice that the values in the year column are formatted as 2,022.0
  4. Convert the format of the Year column from Default to Plain Text in order to get rid of the ,
  5. Notice that there is still a trailing .0 and no way to remove it.

Expected behavior
I expect to be able to remove the .0 from my data. Preferably, I want to change the dtype of the column through the column control panel, even for formula columns. In lieu of that, I want to be able to use formulas to specify the dtype of my column with more granularity. For example, I expect there to be INT and FLOAT Mito formulas.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS Monteray
  • Browser: Firefox
  • Mito Version: 0.3.165
@aarondr77 aarondr77 added bug type: mitosheet Changes the mitosheet package labels Feb 8, 2022
@naterush
Copy link
Contributor

naterush commented Feb 9, 2022

Interesting problem. It seems like there's a couple ways we could approach solving this. The simplest would be just adding a formatting option for showing 0 decimals (which is fine and totally easy, methinks). But this doesn't allow you to remove commas...

Other ways we could approach this:

  1. Custom formats (python code? javascript code? idk).
  2. Splitting number Mito type -> int and float fully, and not treating them as the same type at all.

I might do a little investigation on (2). I'd be interested to see the implications.

@aarondr77
Copy link
Member Author

aarondr77 commented Feb 9, 2022

A third approach, which is future proof for the world where we add more formatting options, is breaking out our existing formatting options into more sensible groups instead of lumping them all as one.

For example, we could have decimal place and number type or something like that. Then, it would be easy to select plain text to say that the type of this data is just plain text that we don't want to stylize with commas, percentages, etc. And then we could also say 0 decimal places.

Being able to choose the type of the number and additional formatting options seems super sensible. If we added color formatting options, we would clearly want that broken out into a separate section as well.

The reason we didn't do this initially is because it gets into a battle of screen real estate & discoverability issues that arise from working around screen real estate issues that we weren't ready for.

@twelsh37
Copy link

twelsh37 commented Feb 10, 2022

  1. Splitting number Mito type -> int and float fully, and not treating them as the same type at all.

I hope you don't mind me jumping in here.
I believe Option two, from a users perspective, is better. It will also allow you to address another bugbear. You can have a different icon to differentiate between int and floats. After all, ints and floats are different.

@naterush
Copy link
Contributor

@twelsh37 thanks for the input! Totally agree that they are functionally different, and so should be visible differently in icons...

As a display of our thanks of you commenting, and so you know we really do appreciate your input, I'll make sure we get a new icon out w/in the next week. You get cred :)

@naterush
Copy link
Contributor

@twelsh37 peep the above PR if you so desire! We've got new icons and sheet functions for treating FLOATs and INTs separate. By-by to treating things as just "numbers" - woo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: mitosheet Changes the mitosheet package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants