Changeset 20035
- Timestamp:
- Jan 10, 2013, 12:03:08 PM (12 years ago)
- Location:
- extensions/edit_gmaps/admin/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/include/XML.php
r9412 r20035 139 139 // This is very difficult to work with, so it needs to be 140 140 // converted to a tree structure before being returned 141 return xml_get_children($newvals, $i=0); 141 $i=0; 142 return xml_get_children($newvals, $i); 142 143 143 144 } -
extensions/edit_gmaps/admin/include/fonctions.php
r12126 r20035 72 72 } 73 73 $num = (int)$num; 74 74 if(empty($ret1)) $ret1=(object) ''; 75 75 // whole number, just return it 76 if( $den == 1 ) return $num; 77 76 if( $den == 1 ) { 77 $ret1->Numerator =($num ) ; 78 $ret1->Denominator=($den); 79 return $ret1; 80 } 78 81 $num2 = $num; 79 82 $den2 = $den; … … 85 88 $den2 = $rem; 86 89 } 87 if( $den2 != $den ) $rem = $den2;88 89 $ret1->Numerator =($num / $rem ) ;90 if( $den2 != $den ) $rem = $den2; 91 92 $ret1->Numerator =($num / $rem ) ; 90 93 $ret1->Denominator=($den / $rem); 91 94 92 95 // now $rem holds the gcd of the numerator and denominator of our fraction 93 96 return $ret1; … … 104 107 $seconds= round(($tmp-$minutes)*6000)/100; 105 108 106 $sec= dec2frac($seconds); 107 109 $sec = dec2frac($seconds); 110 111 //if(empty($ret1)) $ret1=(object) ; 112 $ret=array(); 113 108 114 $ret[0]['Numerator'] =$degrees ; 109 115 $ret[0]['Denominator'] = 1 ; 110 $ret[1]['Numerator'] =$minutes ; 111 $ret[1]['Denominator']=1; 112 $ret[2]['Numerator'] =$sec->Numerator ; 113 $ret[2]['Denominator']=$sec->Denominator; 116 $ret[1]['Numerator'] = $minutes ; 117 $ret[1]['Denominator']= 1; 118 if($sec->Numerator){ 119 $ret[2]['Numerator'] = $sec->Numerator ; 120 $ret[2]['Denominator']= $sec->Denominator; 121 } 114 122 $ret[3]= " Deg: " . $degrees . " Min: " . $minutes . " Sec: " . $seconds." " ; 115 123 $ret[4]= " " . $degrees . "/1 " . $minutes . "/1 " . $sec->Numerator."/".$sec->Denominator ; 124 116 125 return( $ret); 117 126
Note: See TracChangeset
for help on using the changeset viewer.