PHP Classes

PHP Escrever Número Por Extenso: Spell numbers using words in Portuguese

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 83 All time: 10,065 This week: 673Up
Version License PHP version Categories
numeroporextenso 1.0The PHP License5PHP 5, Text processing, Math
Description 

Author

This package is specific mainly for applications used in Brazil Brazil .

This class can spell numbers using words in Portuguese.

It can take a number value and parses it to return words that spell the number with Portuguese words.

The class can spell the number as an amount of a male or female subject, or in the Brazilian currency Real.

In Portuguese:

Esta classe exibe um valor numérico por extenso, sendo possível exibir valor monetário e no feminino.

Picture of Evandro de Oliveira
  Performance   Level  
Name: Evandro de Oliveira <contact>
Classes: 1 package by
Country: Brazil Brazil

Recommendations

number convert to words
my code in php is not working.

Example

<?php
require_once 'config/autoload.php';
$nrValor = '1.234.567.890,50';

//NUMERO POR EXTENSO
$objectNumeroPorExtenso = new Library\numeroPorExtenso($nrValor, false, false);
$strNumeroPorExteno = $objectNumeroPorExtenso->valorPorExtenso();
echo
"NUMERO POR EXTENSO: {$strNumeroPorExteno}";

// NUMERO POR EXTENSO NO FEMININO
$objectNumeroPorExtensoFem = new Library\numeroPorExtenso($nrValor, false, true);
$strNumeroPorExtenoFem = $objectNumeroPorExtensoFem->valorPorExtenso();
echo
"<br><br>";
echo
"NUMERO POR EXTENSO NO FEMININO: {$strNumeroPorExtenoFem}";

// VALOR MONETÁRIO EM REAIS
$objectValorMonetarioPorExtenso = new Library\numeroPorExtenso($nrValor, true, false);
$strValorMonetarioPorExtenso = $objectValorMonetarioPorExtenso->valorPorExtenso();
echo
"<br><br>";
echo
"VALOR MONETÁRIO EM REAIS: {$strValorMonetarioPorExtenso}";


  Files folder image Files (3)  
File Role Description
Files folder imageconfig (1 file)
Files folder imagesrc (1 directory)
Accessible without login Plain text file index.php Example script de teste

  Files folder image Files (3)  /  config  
File Role Description
  Accessible without login Plain text file autoload.php Aux. Arquivo autoload

  Files folder image Files (3)  /  src  
File Role Description
Files folder imageLibrary (1 file)

  Files folder image Files (3)  /  src  /  Library  
File Role Description
  Plain text file numeroPorExtenso.php Class Classe

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:83
This week:0
All time:10,065
This week:673Up