noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 48/162: Protect function nb , return the stri


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 48/162: Protect function nb , return the string if the parameter is not a float
Date: Sat, 11 Jul 2020 13:23:32 -0400 (EDT)

sparkyx pushed a commit to annotated tag E-4
in repository noalyss.

commit 2051243c6541ce89244c62167e9fa64b83934743
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Fri Apr 20 19:25:25 2018 +0200

    Protect function nb , return the string if the parameter is not a float
---
 include/lib/noalyss_csv.class.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/lib/noalyss_csv.class.php 
b/include/lib/noalyss_csv.class.php
index 11df760..4eefce8 100644
--- a/include/lib/noalyss_csv.class.php
+++ b/include/lib/noalyss_csv.class.php
@@ -170,7 +170,11 @@ class Noalyss_Csv
    {
        $p_number=trim($p_number);
        if ($p_number=="") {return $p_number;}
-       $r=number_format($p_number, 4, $this->sep_dec,'');
+       if ( isNumber($p_number) == 1 ) {
+            $r=number_format($p_number, 4, $this->sep_dec,'');
+       } else {
+           $r=$p_number;
+       }
        return $r;
    }
    private function encode($str)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]