// ============================================================================
// numeric.js
// ----------------------------------------------------------------------------
// Nome     : Funções para formatação de números
// Home     : http://www.intergiro.com.br/
// Criacao  : 09/05/2005 10:25AM
// Autor    : Fábio Dias <fabio@interigiro.com.br>
// Versao   : 1.0f
// Local    : São Paulo - SP
// Copyright: 2005 by Fábio Dias.
// ----------------------------------------------------------------------------

//===========================================================================
// Conjunto de funções para a formatação de números
//===========================================================================
//

<!--

//===========================================================================
// Formata moeda
//===========================================================================
function formatCurrency(N){
	texto = N.toString();
	texto2 = ""
	if (texto.indexOf(',') != -1) {
		for (var i = 0; i < texto.length; i++) {
			if(texto.charAt(i) == ",")
				texto2 += ".";
			else
				texto2 += texto.charAt(i);
		}
		texto = texto2;
	}        
          
	texto[texto.indexOf(',')] = ".";
	ponto = texto.indexOf('.');
			
	if (ponto == -1){
	 	texto += ".00";
	 	Term = texto
	}else{
	 	texto += "0";
		decimal = ponto + 3;
		Term = texto.substring(0,decimal);
	}
		
	if (Term == ".0") {
		Term = "0.00";
	}
	if (Term == ".00") {
		Term = "0.00";
	}
	return Term.replace(".",",");
}

//===========================================================================
// Verifica se valor é numérico
//===========================================================================
function isNumeric(str){
	return (!isNaN(str));
}

//===========================================================================
// Verifica se é inteiro
//===========================================================================
function isInteger(str){
	return (isNumeric(str));
}
//-->	