Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

convert scientific notation to decimal php

echo sprintf('%f', floatval('-1.0E-5'));//default 6 decimal places
echo sprintf('%.8f', floatval('-1.0E-5'));//force 8 decimal places
echo rtrim(sprintf('%f',floatval(-1.0E-5)),'0');//remove trailing zeros
 
PREVIOUS NEXT
Tagged: #convert #scientific #notation #decimal #php
ADD COMMENT
Topic
Name
4+5 =