Question
Infosys Ltd
Infosys Ltd
IN
Infosys Ltd
Posted: Dec 21, 2018
Last activity: Dec 21, 2018
Last activity: 21 Dec 2018 12:16 EST
Closed
Solved
Custom Control to Convert rupees to dollars
Hi Team
We have a requirement to convert the rupees to dollars to display on UI. We have to write a custom control ,Since we have to use functionality in multiple places in the application. Can any one help?
Regards
HemalathaM.
Hi
As per our requirement,we have used the below java code for conversion of currency from rupees to dollars. Our requirement is to fetch the dollar rate from DSS.Hence we gave the below function.
<%
String returnValue ="";
String activeValue = tools.getActive().getStringValue().trim();
int DollarRate = Integer.parseInt(pega_rules_utilities.getDataSystemSetting("WorksManagement","DollarRate"));
if(activeValue != null && !(activeValue.equals(""))){
double value = Double.parseDouble(activeValue)/ DollarRate;
if(value>=0){
returnValue= PRNumberFormat.format(null, PRNumberFormat.DEFAULT_DECIMAL, false, null, 2, value );
// returnValue=String.valueOf(value/70);
tools.putSaveValue("result",returnValue);
}
}
%>
<%= returnValue %>
Regards
HemalathaM.