234
Views
11
Comments
Adding .00 decimal field for input box
Application Type
Traditional Web

it should support values upto 2 decimal places. However the total should always be 100.00 for input field

2023-04-06 11-24-23
Paulo Zacarias

Hi Ashwathnarayan, 

Can you please clarify what is the issue that you are facing, perhaps with some images? 

Guessing what you want to achieve is to have some numeric inputs with more than 2 decimal places and then have a 'Total' expression with only 2 decimal places, is that it?

Regards, 

PZ 

UserImage.jpg
Ashwathnarayan K

Hi paulo,


which expression should i use to convert 100 to 100.00

2023-04-06 11-24-23
Paulo Zacarias

Hi! 

Please check the attached OML and see if that's what you are trying to achieve.

If not, we can try to better understand your problem and provide another solution.

Regards, 

PZ

TestModuleDecimals.oml
2023-10-26 15-12-53
Mohammed Rizwan

Hii, @Ashwathnarayan K 

to convert 100 to 100.00 

you ca simply use below expression

FormatDecimal(100, 2, ".", "")

instead of using 100 as static value you can pass your variable on place of 100

Thanks 

Mohd Rizwan

UserImage.jpg
Ashwathnarayan K

Hi Mohm,


After assinging 

FormatDecimal(100, 2, ".", "")

the data still same like 100

if i save 100.00 it will coming with value 0 

2023-10-21 19-42-11
Tousif Khan
Champion

What is the data type of your attribute which you are saving in your DB?

2020-06-20 14-30-28
Oscar Vasconcellos

Hi Ashwathnarayan K, maybe I totally misunderstod your question but are you looking for an Input Mask to input data in "100.00" format? If so take a look at this forge component https://www.outsystems.com/forge/component-overview/7729/input-mask

Best regards,

UserImage.jpg
Ashwathnarayan K

Hi i want to convert to textbox to decimal numbers .

now the textbox is in number and its Db structure is in integer.

please help me in this tried many thing like JS handler, format decimal .

but it still not converting 

2020-06-20 14-30-28
Oscar Vasconcellos

Have you tried "," instead of "."? FormatDecimal(100, 2, "," , "")

Depending on locale the decimal separator is a ",".

2019-09-11 10-03-50
Meer Imtiyaz Ali

Hi

Please use like this 

FormatCurrency(100, "", 2, ".", "") => 100.00


Cheers
Imtiyaz

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.