Answers for "php convert string to float 2 decimal places"

PHP
1

string to float php

$floatValue = floatval("1.0");
Posted by: Guest on May-13-2020
0

Convert String to Float in PHP

phpCopy<?php
$mystring = "0.5674";
echo("This float number is of string data type ");
echo($mystring);
echo("\n");
$myfloat = (float) $mystring;
echo("Now, this float number is of float data type ");
echo($myfloat);
?>
Posted by: Guest on April-23-2021

Code answers related to "php convert string to float 2 decimal places"

Browse Popular Code Answers by Language