PHP Classes

The code can not convert the number 5055 correctly

Recommend this page to a friend!

      Number to Arabic  >  All threads  >  The code can not convert the number...  >  (Un) Subscribe thread alerts  
Subject:The code can not convert the number...
Summary:Any number with zero in middle like 4044 or 400044
Messages:3
Author:md
Date:2016-04-26 09:58:09
 

  1. The code can not convert the number...   Reply   Report abuse  
Picture of md md - 2016-04-26 09:58:09
I just test it on XAMMP v3.2.1

  2. Re: The code can not convert the number...   Reply   Report abuse  
Picture of Emad Mohamed Hossam ElDin Emad Mohamed Hossam ElDin - 2016-10-03 16:02:24 - In reply to message 1 from md
I have managed to fix this code,

replace the for loop in Line 31 with

for($i=0; $i<count($array_number); $i++){
$place=count($array_number) - $i;
$corrected_num = ltrim($array_number[$i], "0000");
$corrected_num = ltrim($array_number[$i], "000");
$corrected_num = ltrim($array_number[$i], "00");
$corrected_num = ltrim($array_number[$i], "0");
$return .= $this->convert($corrected_num, $place);
if(isset($array_number[($i + 1)]) && $array_number[($i + 1)]>0) $return .= ' &#1608;';
}

  3. Re: The code can not convert the number...   Reply   Report abuse  
Picture of ismae ismae - 2020-10-24 08:27:06 - In reply to message 2 from Emad Mohamed Hossam ElDin
Thx %