
META-INF.resources.view.jsp Maven / Gradle / Ivy
<%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ include file="/init.jsp" %>
<%
String from = ParamUtil.getString(request, "from");
if (!CurrencyConverterUtil.isCurrency(from)) {
from = CurrencyConverter.DEFAULT_FROM;
}
String to = ParamUtil.getString(request, "to");
if (!CurrencyConverterUtil.isCurrency(to)) {
to = CurrencyConverter.DEFAULT_TO;
}
CurrencyConverter currencyConverter = CurrencyConverterUtil.getCurrencyConverter(from + to);
double number = ParamUtil.getDouble(request, "number", 1.0);
String chartId = ParamUtil.getString(request, "chartId", "3m");
NumberFormat decimalFormat = NumberFormat.getNumberInstance(locale);
decimalFormat.setMaximumFractionDigits(2);
decimalFormat.setMinimumFractionDigits(2);
%>
<%
for (Map.Entry entry : allSymbols.entrySet()) {
String symbol = entry.getValue();
String currencyValue = entry.getKey();
%>
<%
}
%>
<%
for (Map.Entry entry : allSymbols.entrySet()) {
String symbol = entry.getValue();
String currencyValue = entry.getKey();
%>
<%
}
%>
<%
for (int i = 0; i < symbols.length; i++) {
String symbol = symbols[i];
%>
(<%= symbol %>)
<%
}
%>
<%
for (int i = 0; i < symbols.length; i++) {
String symbol = symbols[i];
%>
<%= symbol %>
<%
for (int j = 0; j < symbols.length; j++) {
String symbol2 = symbols[j];
currencyConverter = CurrencyConverterUtil.getCurrencyConverter(symbol2 + symbol);
if (currencyConverter != null) {
%>
<%= currencyConverter.getRate() %>
1
<%
}
}
%>
<%
}
%>
<%= currencyConverter.getFromSymbol() %>
<%= number %>
<%= currencyConverter.getToSymbol() %>
<%= decimalFormat.format(number * currencyConverter.getRate()) %>
<%
PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setParameter("number", String.valueOf(number));
portletURL.setParameter("from", currencyConverter.getFromSymbol());
portletURL.setParameter("to", currencyConverter.getToSymbol());
%>
3 ,
<%
portletURL.setParameter("chartId", "3m");
%>
3 ,
1 ,
<%
portletURL.setParameter("chartId", "1y");
%>
1 ,
2
<%
portletURL.setParameter("chartId", "2y");
%>
2
© 2015 - 2025 Weber Informatics LLC | Privacy Policy