How to work with decimals discreetly?

Hello friends, is there a way to allow users to type in decimal values with many decimal digits, but only show a fixed amount of decimals in other places of the app without compromising the calculation precision?

Excel for example always calculates with ALL decimals that you give it, but it allows you to tweak how many decimals you want to see at any given time.

In my use case there are times i might need 5 decimals for example, but if i set all my numeric columns to allow for 5 decimals it really phucks up the column width of those columns, and when displaying those values in workflows there is what i call โ€œnumeric column type algebraโ€, that, well, means that whenever i use those columns in operations, the result is going to have the same amount of decimal digits. And that means i have to choose where to drop the decimals in order to display a result in a more aesthetic way.

Bonus: Explained with parrots

If parrots were decimal digits, i want users to type in:

3X_0_d_0df5f0d5d607c35aae60db2620b56912358eb343.gif

But only display:
3X_d_2_d224032a5ff51b64c98e59586d9b4a82ee64c3ea.gif

4 7 481
7 REPLIES 7

I would create an additional field to hold the re-formatted valued.

This is something I do quite often actually. Some might say it goes against good data schema practices (duplicating data), but itโ€™s not really duplicating data:

  • one is for data entry
  • one is for display.

I do the same quite often.

@Rafael_ANEIC-PY

Just to give you an โ€œideaโ€ regardless it fits to your needs or not while we dont have perfect and native solutions out of the box from Appsheet.

When we set the field to decimals (say 2 decimals), they are hard coded and no control after that. The user can not put decimal number 1.020122 where more than 2 decimals. This is what it is.
To remove this restriction, we need to change the field type, suitably just text/strings. Then user can add any number, decimals arbitrarily.

However, we need to validate the entered date is either number or decimals.

I m not doing full check-up, probably I may missed some validation rules, but

and(
isnotblank(extractnumbers([_this])),
sum(extractnumbers([_this]))=decimal([_this]),
decimal([_this])<>0
)

Pushing expression to valid if constrain, we are able to make sure the data entered into this field is just decimals, or numbers. The entry such as

  1. 020 (space inbetween)
    a12.0115 (no numeric value)

etc could be ruled out.

Once we capture the proper number/decimals with arbitrary number of decimals as you want, then you manupulate this data by convering to decimals type using other virtual column.

Just as an idea as your starting point.

Hey guys ! @MultiTech_Visions @tsuji_koichi thank you for your advice, iโ€™ll think more about it and return to you with the results, i was hoping there was an easier way to deal with it, hmm, maybe I should post it as a feature request then?

If i do, do i have your voโ€ฆ never mind hehe

You mean like this?

Yes ! thatโ€™s exactly what i had in mind too, i didnโ€™t find it because i was looking for โ€œdecimalsโ€, but as a solution it fits perfectly.

Hello friends, itโ€™s me ya boy again. 3X_e_8_e8ab1a39b41842f5035077bf218aff486737f38b.gif
I opted for a combination of @MultiTech_Visions and @tsuji_koichi san solutions while we wait for our feature request getting worked on @Marc_Dillon hehe.

For inside the app, iโ€™ll do this:

For the workflows @tsuji_koichi sanโ€™s post made me realize i donโ€™t need appsheet to handle the decimals for me, i can just round it however i want and turn it into text ! and also append the currency symbol to the left.

You guys turned a massive headache of mine into so many new ideas, thank you !

Top Labels in this Space