Units in columns

Hi im new here and i am trying to develop a small web application. Anvil is a very lovely framework, very nice workflow. But i have a little problem for now…

My problem now is, that i want to add a € sign to my numbers in specific columns in my table on client side.

Is there any way to format the numbers in the table?

I tried to update the rows with the € sign on server side before returning them to client, but that does not work of course, because the colum has type number not string.

The only way i see for now is to turn the column into type string and add the sign to every value, but i hope you have another idea to realize this.

Thank you in advance!
Alex

Hi and welcome to the forum.

I can think of two main ways, one is as you have said store the value as a string with the sign but you give up a fair bit of functionality.

The second is to leave it as a number column and whenever you display the data on client side code you can format the value there. This is how I approach it.

You can use an f string to format the label with a data binding. This way you only need to write the binding once and which ever row you load in to it will be formatted correctly.

1 Like