Question
Foray Software Pvt Ltd
IN
Last activity: 8 Feb 2018 21:55 EST
Number and Currency Formats Changing
Hi Everyone,
1.I have a number "12345678901234" like this but need to display on UI like "123-456 7890 1234" in this format.
2. I need to change currency from USD 1,000 to symbol $1,000
Pls help me how to change these formats..
***Edited by Moderator Marissa to update categories***
Thanks
Krishna
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi
You can edit the property values from the Edit Input of Advanced tab of the property.
There are some OOTB edits given, but you can write your own code to suit your requirements.
Foray Software Pvt Ltd
IN
Hi,
Thanks for the reply. Can you tel me what edit-input method we have use for above exact requirement.
Thanks
Krishna
Pegasystems Inc.
US
I tried with the below sample code for the 1st use case in Edit Input rule and applied on the property to check the behavior,
String Input = theValue;
theValue = Input.substring(0,3)+ "-" + Input.substring(3,6) + " " + Input.substring(6,10) + " " + Input.substring(10,14);
}
-
Sagar Chavan
Pegasystems Inc.
US
For your second use case if you create the Currency type property in your case and use it in your section then the value 1000 is converted to $1,000.00 as shown in the attachment.
Foray Software Pvt Ltd
IN
I have created only property Mahesh not using case here.
pls help
-
Mohamad Shokor Pawel Adamczuk Tom Zhang Yao Yao
Pegasystems Inc.
US
Use the pxCurrency control in the UI where you are using this property, which might also work.
Foray Software Pvt Ltd
IN
I am really thankful for the help..
Its working 100%
Could you please help 2nd requirement also need to $ symbol to Number Example:$500
Kindly awaiting your reply
Thanks
Foray Software Pvt Ltd
IN
Hi Mahesh
I have a doubt here
if i have a 'n' digits or if i don't know the exact number what the customer is entering then how to use it?
pls help
Pegasystems Inc.
US
As you had specified the input string as "12345678901234" and expecting it to convert into "123-456 7890 1234", i had written the above code as per this requirement. If you are not aware of the exact number what customer is entering then above doesn't work, as the above code just returns the same string if it is less than or more than 14 characters.
In this case you need to find the pattern how the numbers need to be displayed and write your logic accordingly to construct the string based on length/
Foray Software Pvt Ltd
IN
i dont know the exat card num
which logic i need to write if string length is < 20,
pls help me with code for '<' and ">"
kindly awating,
thanks
Foray Software Pvt Ltd
IN
Hi,
Geeting error pls help
property Name= CardNumber
Property type= formatted text
Getting default value to 'CardNumber' from the data transform.(not entering input value)
this is the exact requirement bro.
pls help me'
Pegasystems Inc.
US
In this case you can write the function take the input string and return the formatted string in this function by using the above java code in it. This function you can use while setting the CardNumber value in data transform.
Foray Software Pvt Ltd
IN
could you pls send me the exact code
kindly requestng you
thanks
Pegasystems Inc.
IN
For appending $ value, create an edit-input rule and paste the following code and refer that
Foray Software Pvt Ltd
IN
It is getting error to submit value
need prepend Mojjs not append
could u pls check once again and help me'
Thanks
Ncs Pte Ltd
SG
Try this
-
Pavan Kumar Thata
Foray Software Pvt Ltd
IN
Hi,
Geeting error pls help
property Name= Balance
Property type= formatted text
Getting default value to 'Balance' from the data transform.(not entering input value)
this is the exact requirement bro.
pls help me'
Ncs Pte Ltd
SG
Changed your formatted text as below
-
Sagar Chavan Murari DurgaPrasad Aditya Kumar Gupta Rohit Singh