Skip to content

Commit c79cbe0

Browse files
committed
Fix a case where PHP notice could be generated
In case where . is not present in floats, explode would not generate [1]. So we needed to check whether it is present before comparison
1 parent 117fab4 commit c79cbe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ntwIndia/class-ntw-india.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function num_to_word( $number ) {
160160
$dot = explode( '.', $number );
161161
// If there is some integer after the dot and not just zero
162162
// then we consider adding XXX/1000 to it
163-
if ( $dot[1] > 0 ) {
163+
if ( isset( $dot[1] ) && $dot[1] > 0 ) {
164164
// We dont need the and here
165165
$this->first_call = false;
166166
return $this->convert_number( $dot[0] ) . ' ' . $this->and . ' ' . intval( $dot[1] ) . '/1' . str_repeat( '0', strlen( $dot[1] ) );

0 commit comments

Comments
 (0)