Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ali3bdalla committed Sep 23, 2019
1 parent 79246ab commit c281caf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 23 additions & 5 deletions Tafqeet.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private function getRightPosition($number,$index,$len)
{
$position = $len - $index;
// ;
if($index==0 && $number<=3 && $len >= 4)
if($index==0 && $number>=3 && $len >= 4)
{
$arr = $this->detectTheTargetedArrayForTheCurrentPosition(1);
$arr2 = $this->detectTheTargetedArrayForTheCurrentPosition($position);
Expand All @@ -109,7 +109,7 @@ private function getRightPosition($number,$index,$len)
}


if($index==1 && $number<=3 && $len >= 5)
if($index==1 && $number>=3 && $len >= 5)
{
$arr = $this->detectTheTargetedArrayForTheCurrentPosition(1);
$arr2 = $this->detectTheTargetedArrayForTheCurrentPosition($position);
Expand All @@ -118,7 +118,7 @@ private function getRightPosition($number,$index,$len)
}


if($index==2 && $number<=3 && $len >= 6)
if($index==2 && $number>=3 && $len >= 6)
{
$arr = $this->detectTheTargetedArrayForTheCurrentPosition(1);
$arr2 = $this->detectTheTargetedArrayForTheCurrentPosition($position);
Expand All @@ -127,6 +127,22 @@ private function getRightPosition($number,$index,$len)
}


if($index==3 && $number>=3 && $len >= 7)
{


$arr = $this->detectTheTargetedArrayForTheCurrentPosition(1);
$arr2 = $this->detectTheTargetedArrayForTheCurrentPosition($position);
return $arr[$number] .' '. $arr2[1];
}









$arr = $this->detectTheTargetedArrayForTheCurrentPosition($position);

Expand Down Expand Up @@ -261,7 +277,9 @@ private function doWork()
$words = '';
$words.= $this->getWordsForNumberBeforeComma();
$words.= $this->getWordsForNumberAfterComma();
return $words.='فقط لاغير';
$words.='فقط لاغير';
return str_replace(' ',' ',$words);

}


Expand All @@ -272,7 +290,7 @@ private function doWork()

}

$work = new Tafqeet('323434.47');
$work = new Tafqeet('3234434.47');

print_r( $work->run());
echo "\n";

0 comments on commit c281caf

Please sign in to comment.