I have written a CSV importer and some of the values are very small, for example, in one of the CSVs I have 0.000024 which is being formatted as "2.40E-05" and when PHP puts that into the database it stores it as 2.4, I found an article that said if you add 1 to it, it changes to a float which is what I did and I got 1.000024, but if I then subtract 1, it goes back to being 2.4E-05, what is the best way in PHP to convert a scientific notation string to an actual float value? I would like to be able to store the value in my database as 0.000024.
How do I convert scientific notation string to float in PHP?
306 Views Asked by Elliott Coe At
1
There are 1 best solutions below
Related Questions in PHP
- How to add the dynamic new rows from my registration form in my database?
- Issue in payment form gateway
- How to create a facet for WP gridbuilder that displays both parent and child custom fields?
- Function in anonymous Laravel Blade component
- How to change woocomerce or full wordpress currency with value from USD to AUD
- General questions about creating a custom theme Moodle CMS
- How to add logging to an abstract class in php
- error 500 on IIS FastCGI but no clue despite multiple error loggings activated
- Composer installation fails and reverts ./composer.json and ./composer.lock to original content
- How to isolate PHP apps from each other on a local machine(Windows or Linux)?
- Laravel: Using belongsToMany relationship with MongoDB
- window.location.href redirects but is causing problems on the webpage
- Key provided is shorter than 256 bits, only 64 bits provided
- Laravel's whereBetween method not working with two timestamps
- Implementing UUID as primary key in Laravel intermediate table
Related Questions in NUMBERS
- Find the sum of the numbers in the sequence
- Partitions in co-lexicographic order (PARI/GP algorithm without recursion)
- Predict numbers from labeled images
- Increment number on each node with excluding one
- Ansible Increment Number on each node
- Find non numeric data for a column between duplicate key records
- Algorithm for rounding and clamping a number to specific ends
- Ahk gui does not display double digit numbers
- Using Javascript on Mac get selected row number from Numbers spreadsheet
- Peudorandom numbers in c++ not random enough
- Sensitive operations with big numbers in C++
- AppleScript: "System Events" from Terminal not working
- C++ converting binary string to decimal string
- How to convert HTML "span" + "input" elements to Number?
- Is there an easy way to get the max number from a String in PL/SQL
Related Questions in SCIENTIFIC-NOTATION
- VBA script/clean/remove hard spacing/remove scientific "E+" notations/and save as Unicode text
- EXCEL LinEst function returns nonsense when Const=False and numbers <1E-7
- Scientific notation on the axis (literature style) - how to change default font?
- Ruby - Converting Small Float Numbers to String
- How to change the format/notation of the scale after the y-axis break (ggbreak)?
- Php subtract returns a scientific notation value
- Is there a way to input a dataset made up of a string of 0's and 1's into R without scientific notation?
- VBA converts number into scientific notation when writing to csv file
- Convert scientific notation number Xe+N to an integer in bash script
- Scientific notation in chart director
- Scientific notation in list form in Python
- pandas to csv without converting object to scientific notation
- Why can't Julia parse functions parse numbers in scientific notation with d instead of e?
- Scientific notation in Python - extra digits
- Scientific form solution from sy.solve(polynomial equation)
Related Questions in NOTATION
- Do not want scientific notation on plot axis again
- Turning infix notation to prefix notation has problems in formatting (Python)
- Alphatab tutorial won't load Guitar Pro files
- How to write a number in scientific notation in Python keeping the mantissa as integer
- React dot notation component passing between components
- How do I convert values that are given in scientific notation into decimals?
- How can I return an object that supports dict and dot-notation from SQLite queries in Python?
- Representing logical operations in math/logical notation
- Formatting numerical tick labels into exponential notation in ggplot2, without rescaling x- or y-axis
- How to return scientific notation with only a few decimal places with the notation still intact?
- why scientific notation leaves an extra character "1" after e in R?
- Normal to RPN conversion
- Normalizing a board game notation
- What would be the time complexity of this code? Big O notation
- What does this for loop syntax mean?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You should convert to a string otherwise if you keep the float it will keep displaying with scientific notation