RE: [PHP-ES] de String a int

From: Date: Mon, 27 Nov 2000 16:20:54 +0000
Subject: RE: [PHP-ES] de String a int
References: 1 2  Groups: php.general.es 
Request: Send a blank email to general-es+get-4292@lists.php.net to get a copy of this message
multiplica la variable * 1 $aux = $number * 1 ----- Original Message ----- From: Juan Jose Sanchez Mesa <juanjo.listas@doblej.net> To: <lista@phpes.com> Sent: Monday, November 27, 2000 3:50 PM Subject: Re: [PHP-ES] de String a int > Pues como siempre, una simple mirada al manual nos descubre este apartado: > > ------------- > > number_format > > (PHP 3, PHP 4 ) > > number_format -- Format a number with grouped thousands > > Description > > string number_format (float number, int decimals, string dec_point, string > thousands_sep) > > Number_format() returns a formatted version of number. This function > accepts either one, two or four parameters (not three): > > If only one parameter is given, Number will be formatted without decimals, > but with a comma (",") between every group of > thousands. > > If two parameters are given, number will be formatted with decimals > decimals with a dot (".") in front, and a comma (",") between > every group of thousands. > > If all four parameters are given, number will be formatted with decimals > decimals, dec_point instead of a dot (".") before the decimals and > thousands_sep instead of a comma (",") between every group of thousands. > > ---------------- > > > Facil, no ? > > At 12:28 27/11/2000, you wrote: > >Tengo una variable de tipo string con un valor numerico pero necesito > >transformarla a tipo int, con 2 decimales, como puedo hacer? ya que probé > >con settype ($variable,"integer"), pero me la muestra igual en pantalla, sin > >decimales ni nada > > > > > >--------------------------------------------------------------------- > >Archivo On-line: http://www.phpes.com/ > >Manual PHP en español: http://www.php.net/manual/es/ > >Para dar de baja la suscripción, mande un mensaje a: > > lista-unsubscribe@phpes.com > > > > --------------------------------------------------------------------- > Archivo On-line: http://www.phpes.com/ > Manual PHP en español: http://www.php.net/manual/es/ > Para dar de baja la suscripción, mande un mensaje a: > lista-unsubscribe@phpes.com > >

« previous php.general.es (#4292) next »