format on label component

Questions and answers for designing and implementing forms in Servoy

format on label component

Postby andre1506345542 » Wed Aug 29, 2018 8:59 am

Hi

I have a calculated field, which I want to show on a label in a table view.
The calculated field returns a number variable. But it is always an integer.
The label now displays the number with one decimal. eg. 1.0 5.0 or 11.0 etc instead of 1 5 or 11

I have tried to change the format property of the label, but with out success.

How can I show the number as an integer.

Temp fix: Now, I return a string from the calculated field. But that is not really the way to go.

Thanks
Andre
andre1506345542
 
Posts: 30
Joined: Mon Sep 25, 2017 3:19 pm

Re: format on label component

Postby sean » Wed Aug 29, 2018 5:03 pm

Hi Andre,
I cannot reproduce this issue. The default format of the label should be what you see.

What version of Servoy?
And what client type please? (i.e. NGClient, Smart Client, etc)
What is the declared datatype of your calculation?
What format strings have you tried?

You could check your default number format on the servoy admin page. Perhaps it is #.0
But this would be overridden by the element format. So it's not clear to me why this happens.
Software Engineer
Servoy USA
sean
 
Posts: 111
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: format on label component

Postby andre1506345542 » Thu Aug 30, 2018 8:48 am

Hi Sean
I use 8.3.1 NG Client.
Declared value is a Number. As so far I know there is no integer.
The label is a normal servoy label on a table view. The calculated field returns a Number.

I have tried
####
####.
###0

On admin page the locale.numberformat and locale.integerformat are empty.

Thanks
andre1506345542
 
Posts: 30
Joined: Mon Sep 25, 2017 3:19 pm

Re: format on label component

Postby andre1506345542 » Thu Aug 30, 2018 8:52 am

BTW Sean,
I tried to make a test solution but there it works fine. But I did not create a calculated but just a regular function.
We use i18n.setLocale, can this cause something.

Brdgs
Andre
andre1506345542
 
Posts: 30
Joined: Mon Sep 25, 2017 3:19 pm


Return to Forms

Who is online

Users browsing this forum: No registered users and 4 guests

cron