$rootbeer = (float) $InvoicedUnits;
Should do it for you. Check out Type-Juggling. You should also read String conversion to Numbers.
More Related Contents:
- Converting an integer to a string in PHP
- How to convert string to boolean php
- PHP unexpected result of float to int type cast
- How to cast array elements to strings in PHP?
- How do I check if a string contains a specific word?
- startsWith() and endsWith() functions in PHP
- PHP – concatenate or directly insert variables in string
- Replacing accented characters php
- How to remove accents and turn letters into “plain” ASCII characters? [duplicate]
- Convert a comma-delimited string into array of integers?
- How to get everything after a certain character?
- Get first 100 characters from string, respecting full words
- PHP remove special character from string
- Iterate over each line in a string in PHP
- Generate SEO friendly URLs (slugs) [closed]
- PHP: How can I explode a string by commas, but not wheres the commas are within quotes?
- How to get int instead string from form?
- Print newline in PHP in single quotes
- How can I remove part of a string in PHP? [closed]
- PHP String Manipulation: Extract hrefs
- How to convert PascalCase to snake_case?
- Get last whole number in a string
- Include constant in string without concatenating
- Remove Trailing Slash From String PHP
- checking if a number is float in PHP
- Measure string size in Bytes in php
- Explode a paragraph into sentences in PHP
- Remove first 4 characters of a string with PHP
- PHP extract link from tag [duplicate]
- PHP Find all occurrences of a substring in a string