1073
Views
8
Comments
Currency Format
Application Type
Reactive

Hi All,

I have an Input widget bounded with some variable. I want to add "$" sign but unable to do in an input like we can concatenate in an expression.

I can't use any forge component. So without forge component Is there any idea how we can implement ?


Thanks

Tanisha Mahendru

UserImage.jpg
vikas sharma
Champion

Hi Tanisha,

For this I think you can use the onchange event of input field. Whenever user enter any value in input filed OnChange will be trigger and you need to append "$" sign with amount. Like amount value stored in variable X. User entered amount 100 so in OnChange, you will do

X = "$"+X;

regards

2022-04-15 04-42-41
Tanisha Mahendru

Hi Vikas,

Thanks for your Reply. But the scenario is that input is not editable. Only we have to display amount with $ sign. If you have any suggestion then let me know.


Regards

UserImage.jpg
vikas sharma
Champion


So considering that you have to only show the value on the screen. For this scenario when you fetch the value of amount from aggregate or data action. Just use onAfterFetch of aggregate or data action. In OnAfterFetch, assign value like "$"+Amount fetched in a local variable. Then bind this local variable with the desired input field.

regards

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Tanisha,

In addition to the previous suggestion. Make sure that the Input widget's Input Type and associated Variable are of Text data type.

Also, you can use the FormatCurrency in-build function to format the currency value and assign the formatted value to the variable associated with the input.

FormatCurrency(87.63, "$", 2, ".", ",")

Demo: CurrencyFormat_Input

I hope this helps you!


Kind regards,

Benjith Sam

2022-09-12 06-18-21
Bernard Cheng

Try using InputMask library. However its only for React application. It has currency controls and prefix. I believe the currency Inputmask is perfect for your requirements.

2022-04-15 04-42-41
Tanisha Mahendru

Hi,

Thanks for the reply. But I am not allowed to use this.

2021-08-12 05-19-40
Shubham Janbandhu

Hi Tanisha, 

I don't know from where the data is coming but I tried something and you can try this, 

If the input is disabled means user could not edit it so in that situation you can use container and adjust the css as per input box and inside that Container you can have Expression and assign value as "$" + variable.

Example:

 



yes it is bit different method but you can use it and adjust it as it is an expression now.

Regards, 

Shubham 

2022-07-24 08-50-37
Gokula Kannan P

Hi @Tanisha Mahendru,

Find the below-attached OML for your reference.

I hope this will resolve your problem. 


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