diff --git a/common/src/main/java/com/genexus/CommonUtil.java b/common/src/main/java/com/genexus/CommonUtil.java index 88b64ed3e..f0e02222e 100644 --- a/common/src/main/java/com/genexus/CommonUtil.java +++ b/common/src/main/java/com/genexus/CommonUtil.java @@ -2923,7 +2923,7 @@ public static String strNoRound(double value, int length, int decimals) } - static String str(BigDecimal value, int length, int decimals, boolean round) { + public static String str(BigDecimal value, int length, int decimals, boolean round) { if (length - 1 <= decimals) { // Esto es que hizo str(_, 2, 1) o str(_, 3, 2), todas cosas diff --git a/common/src/main/java/com/genexus/IDelimitedFilesSafe.java b/common/src/main/java/com/genexus/IDelimitedFilesSafe.java index 077891f48..9e0227e35 100644 --- a/common/src/main/java/com/genexus/IDelimitedFilesSafe.java +++ b/common/src/main/java/com/genexus/IDelimitedFilesSafe.java @@ -27,7 +27,9 @@ public interface IDelimitedFilesSafe { byte dfwopen(final String filename, String fdel, final String sdel, final int append, final String enc); byte dfwnext(); - byte dfwpnum(double num, int dec); + byte dfwpnum(long num, int dec); + byte dfwpnum(BigDecimal num, int dec); + byte dfwpnum(double num, int dec); byte dfwptxt(String txt, int len); byte dfwpdate(Date date, String fmt, String sep); byte dfwclose(); diff --git a/common/src/main/java/com/genexus/util/DelimitedFilesSafe.java b/common/src/main/java/com/genexus/util/DelimitedFilesSafe.java index d72bcaa88..b7eae87e7 100644 --- a/common/src/main/java/com/genexus/util/DelimitedFilesSafe.java +++ b/common/src/main/java/com/genexus/util/DelimitedFilesSafe.java @@ -756,12 +756,27 @@ public byte dfwpnum(int num) return 0; } + public byte dfwpnum(long num, int dec) + { + return dfwpnum(new BigDecimal(num), dec); + } + + public byte dfwpnum(BigDecimal num, int dec) + { + String doubnum = CommonUtil.ltrim(CommonUtil.str(num, 20 + dec, dec, true)); + return dfwpnum(doubnum, dec); + } public byte dfwpnum(double num, int dec) + { + String doubnum = CommonUtil.ltrim(CommonUtil.str(num, 20 + dec, dec)); + return dfwpnum(doubnum, dec); + } + + private byte dfwpnum(String doubnum, int dec) { byte retval = GX_ASCDEL_SUCCESS; if (dfwopen_in_use) { - String doubnum = CommonUtil.ltrim(CommonUtil.str(num, 20 + dec, dec)); int k = doubnum.indexOf("."); if (dec == 0) {