Hi everyone,
I have two questions here,1. Is it possible to display the number 0 rather than blank in an input field after we fetch from the database?
2. Is it possible to display trailing zeros (.00) ? eg. 25.00
I’m looking for suggestions or workarounds for the above two issues that would allow us to achieve this while keeping the field type as "number" for calculations, or if there’s an alternative solution besides change the type to "text"
Thanks in advance
Hey!For your first question:
If you want to display 0 instead of blank, you can add the following attribute in your number input :
https://www.outsystems.com/forums/discussion/61678/when-adding-0-as-a-value-to-form-its-showing-empty-field/#(Check João Santos' answer)
https://www.outsystems.com/forums/discussion/33763/outsystems-ui-input-widget-doesnt-display-zero-value/#
(Check Rita Dias' answer)
For your second question:
I am not sure right now and dont have access to service studio. Will try to check it tomorrow.
Hi @Prejith Prasanna Kumar ,
I think you are looking for this result:
For that I attached below OML please refer.
For second point you can use outsystem default function formatDecimal().
For first query instead of changing input field data type you can change variable that is bind with that input field make them text type.
Regards,
Rajat
Hi @Rajat Agrawal ,
Thanks for the response. Although it's not quiet what I was looking for. I can see you have used the input type for the input field as text, but I was wondering if there is any way to achieve both of those cases when the Input type is number.
Same scenario they have discussed in below post also you can refer that without using datatype text.
https://www.outsystems.com/forums/discussion/78204/check-if-0-is-in-input-field/
Hi @Prejith Prasanna Kumar,
As much understood from your question, below are few solutions :-
I hope it will help.
Ojasvi Sharma