Enum with Base Type Decimal

When we use Enum with Base Type Decimal, and set the values to like
0.5
1.0
1.5
and so on, the Dropdown gives me
0.50
1.00
1.50

Can we change this?

1 19 1,018
19 REPLIES 19

Hi @Fabian,

Please explore if this helps. You could set the column type as โ€œDecimalโ€ with decimal digits setting of 1 and valid if setting with a list such as [0.5,1.0,1.5,2.0,2.5}

Then the corresponding column shows and saves with one decimal digit.
2X_f_faba7f14777f745243949589175460beccd8ecb3.png

Thank you very much @Suvrutt_Gurjar.
But in my case I have to use an ENUM with Base Type Decimal.
Because I want to use not only
0.5
1.0
1.5
but also Text values like
WP
IP

This is working without any problem.

I canโ€™t use ENUM with Base Type Text, because I need to calculate in another table with the Decimals.

One way is if you use base type as text and when you need to make some caluclations, change the value to decimal like DECIMAL([EnumColumn])

Hi @Fabian,

Thank you for your updates. Got that you have text values as wellโ€ฆ

Hi @Aleksi,

Your input as usual is practical considering @Fabianโ€™ s requirement.

Thank you both for your input. I will try that.

Hi @Aleksi
I think in my case this is not working, because Iโ€™m using a reference like:
SUM([REF_ROWS_COLUMN][ENUM])

If [ENUM] is base type Text, I cannot use the expression.
And SUM(DECIMAL([REF_ROWS_COLUMN][ENUM])) ist not working.

Is there another workaround?

You would need to have a separate decimal field with a proper formula and then use that column instead of the original for the SUM().

Okay, so you mean an additional VC column that converts the Text value into Decimal.
And then use this VC to calculate like:
SUM([REF_ROWS_COLUMN][ENUM_VC])

Correct.

This is what I had before. But I want to get rid of all these VC columns that are consuming sync time.
Thatโ€™s why I asked in my first post, if we could change the Enum Base Type Decimal to just 1 Decimal Digit.

Though you can use normal column instead of virtual.

Thatโ€™s a nice idea. Would you prefer normal columns instead of virtual column? What is better for sync time and performance?

In this case I would use normal column because it doesnโ€™t need to be dynamicโ€ฆ like reading values from another table.

Okay thank you that makes sense.

I have to revise myself: ENUM with Base Type Decimal does not allow Text values. I mean, the App Editor allows. But when you select a Text value und sync it says, itโ€™s not compatible.
So I definitely have to go the way with creating another column with AppFormula DECIMAL([EnumColumn]).

My coloumn type is โ€œENUMโ€. The base type is decimal. I have enabled the โ€œAllow other valuesโ€ option. But I only see two decimal places. Wants to increase it to three decimal places. Or I get errors in my calculations. How do I fix that?

Change it to Decimal type and write values into โ€œSuggested valuesโ€ option like LIST(0.123,123.123). Then you have control for decimal digits.

If this was not right for me. I used โ€œvalid ifโ€ to add the data in the table to the โ€œENUMโ€ list. But it only shows me two decimal places. I must point out 3 decimal places in it. As you said, adding values to โ€œSuggest valueโ€ did not work


3X_1_d_1d94d66dc3a85c1670e14265ca175346dfde116b.png

Try to change the data type to decimal instead of enum and set the decimal point to 3, while you keep the list expression within either valid if or suggested value

Top Labels in this Space