wordToNumber() 공개 정적인 메소드

Converts words to numbers
public static wordToNumber ( string $text ) : string
$text string
리턴 string
예제 #1
0
파일: UtilsTest.php 프로젝트: lavary/crunz
 public function testWordToNumber()
 {
     $this->assertEquals(65, Utils::wordToNumber('sixty five'));
     $this->assertEquals(892, Utils::wordToNumber('eight hundred ninety two'));
     $this->assertEquals(5438, Utils::wordToNumber('five thousand and four hundred thirty eight'));
 }
예제 #2
0
파일: Helpers.php 프로젝트: lavary/crunz
 /**
  * Convert words to numbers
  *
  * @param  string $text
  *
  * @return string
  */
 function word2number($text)
 {
     return Utils::wordToNumber($text);
 }