Hi, I’m looking through the docs and forum but cannot find the answer - is it possible to elegantly define a number format for a TextBox of a number type which is bind both ways to a data table? My app deals with a rather huge numbers, like 63117869662.0971 for which I’d like to display 63,117,869,662.0971.
One way to deal with this is through show and change events, probably?
I use a Link (formatted such as: "{0:.2f}".format(number) ) which hides on click and shows a number TextBox instead. Then on lost_focus of the textbox the textbox is hidden and Link shown with the formatted number.
Hi there! I’m new to anvil and even though the answer reads simple to implement I’ven’t been able to replicate it.
I suppose that you defined a click event (def link_1_click(self, **event_args): ) and then do the steps you mention after. How exactly is that done? I’ve been trough the anvil documentation and didn’t get any clear idea on how to link to a text box neither to the lost_focus or link formatting.
I’d really appreciate any help to understand this example.
And other question I was wondering, the number written can be then called from a function as a usal text box?
This is an old question that has already been answered, you are not showing what you have tried and are not formatting the code in the post. You are unlikely to get an answer here.
If you want to increase your chances, go through some tutorials and when you have something to show that doesn’t work, create a new question: How to ask a good question