Author: jleroux
Date: Wed Nov 17 20:33:08 2010 New Revision: 1036206 URL: http://svn.apache.org/viewvc?rev=1036206&view=rev Log: I thought it could be useful for the elrte Editor problem but it was not the case. I commit though, as it could prove useful in the future Modified: ofbiz/branches/jquery/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java Modified: ofbiz/branches/jquery/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java?rev=1036206&r1=1036205&r2=1036206&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java (original) +++ ofbiz/branches/jquery/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java Wed Nov 17 20:33:08 2010 @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +/************************************** This file has been modified by Open Source Strategies, Inc. **************************************/ package org.ofbiz.base.util; import java.math.BigDecimal; @@ -503,6 +504,21 @@ public class UtilFormatOut { return retString; } + /** Decodes an XML string putting back the characters '<', '>', '"', ''', '&' + * @param inString The encoded String + * @return The plain value String + */ + public static String decodeXmlValue(String inString) { + String retString = inString; + + retString = StringUtil.replaceString(retString, "&", "&"); + retString = StringUtil.replaceString(retString, "<", "<"); + retString = StringUtil.replaceString(retString, ">", ">"); + retString = StringUtil.replaceString(retString, """, "\\\""); + retString = StringUtil.replaceString(retString, "'", "'"); + return retString; + } + public static String padString(String str, int setLen, boolean padEnd, char padChar) { if (str == null) { return null; @@ -543,4 +559,23 @@ public class UtilFormatOut { buffer.append(original.substring(original.length()-4)); return buffer.toString(); } +/************************************** This file has been modified by Open Source Strategies, Inc. **************************************/ + + /** Formats a double into a properly formatted currency string based on isoCode and Locale + * @param price The price double to be formatted + * @param isoCode the currency ISO code + * @param locale The Locale used to format the number + * @return A String with the formatted price + */ + public static String formatCurrency(double price, String isoCode, Locale locale) { + return formatCurrency(price, isoCode, locale, -1); + } + + /** Formats a double into a properly formatted currency string based on isoCode and Locale + * @param price The price double to be formatted + * @param isoCode the currency ISO code + * @param locale The Locale used to format the number + * @param maximumFractionDigits The maximum number of fraction digits used; if set to -1 than the default value for the locale is used + * @return A String with the formatted price + */ } |
Free forum by Nabble | Edit this page |