Add symbol to float number on rows of datagrid

Hello, hope all are fine, im trying in last days to show on datagrid (rows) some integer and float number with adding symbol like ’ % ', can be possible to add it directly on row without make change on datatable?

Thank you so much!

Assuming that you mean the Data Grid’s row, not the database table row, yes, it’s possible.

I’ll cover the simplest case, i.e., when the number is purely for display (e.g., in a Label) , not data entry (a TextBox). In the data binding, your’re probably using something like

self.item['column_name']

as the formula for the value to be displayed. Since the value is read-only, you can use a more sophisticated formula, one that does not simply name a value, but formats it, too. For example:

f"{self.item['column_name']:.3f}%"

See:

1 Like