Replies: 1 comment 2 replies
-
In fact, we have a metric visual element that will be released in the next release. You can use our develop branch by You have an issue in this sentence; you have not closed the
I suggest not having def format_number(x):
# do whatever you want here. When *state.x* changes, this function will be called.
return x.get('a',{}).get('b',{}).get('',0)
self.x = {'a': {'b': {'': 12345.67890}}}
with tgb.part('card'):
tgb.text(f"**Headline**", mode='md')
tgb.text("{format_number(x)}") I am not sure about the error with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I am trying to show some KPIs, inspired by what streamlit's st.metric() does.
And
tgb.text()
gives me some headache...The basic Idea works with:
1st issue: format does not work as expected
Result:
12345.6789
12346
12.345,679
2nd issue: handling of expressions is not working as expected
taipy_app-1 | x.get('a',{
taipy_app-1 | ^
taipy_app-1 | SyntaxError: '{' was never closed
Fun-Fact 1:
works!
Fun-Fact 2:
using
x.get('a')
the format arg is completely ignored, withx['a']
it works as described aboveBeta Was this translation helpful? Give feedback.
All reactions