How to display floating point number from table show as digit format [duplicate]

StackOverflow https://stackoverflow.com/questions/22813701

  •  26-06-2023
  •  | 
  •  

Domanda

In my table i have the record value 0.0000009 like this since i run my program i got result like this 9.0E-7. But i need to display 0.0000009 this format.

<?php echo $a=0.0000009; ?>

Kindly guide me

È stato utile?

Soluzione

You can use formatting print, %f means that you bind float value, "1" symbols before point, "8" after point:

echo sprintf('%1.8f', 0.00000009); 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top