• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
0

Convert int to float in php

how do i convert int to float in php like 4.0+4.0 should be 8.0 display

phpdata-typestype-conversionfloatint
23rd Dec 2018, 7:28 AM
Vikraant
1 Answer
+ 3
You can use floatval to make sure the calculation done in float, then use number-format for the display http://php.net/manual/en/function.floatval.php http://php.net/manual/en/function.number-format.php
23rd Dec 2018, 7:54 AM
Taste
Taste - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Decorators in python.
2 Votes
How to install Bcrypt here
1 Votes
Codegames
1 Votes
ŰčÙŰ§ÙƒÙ… ŰšŰșيŰȘ Ù†ŰłÙˆÙ„ÙƒÙ… ÙƒÙŠÙŰ§ŰŽ Ù†ŰŻÙŠŰ± ÙƒÙˆŰŻ ويكون Ű”Ű­ÙŠŰ­ŰŸ
1 Votes
What is happening with sololearn
1 Votes
CAN I FOLLOW YOU🙏🙏!!!
2 Votes
Can sololearn have multiple inpus&outputs?
3 Votes
CAN ANYONE TELL ME WHAT TO LEARN NEXT AFTER ADVANCED PYTHON CONCEPTS
1 Votes
Programming language learning
0 Votes
How can I add images to my website
0 Votes