C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
MySQL TRUNCATE FunctionThe truncate() is a Math function of MySQL. This function is used to get the given number truncated up to given certain decimal places. Syntaxselect truncate(number, decimal_places); Parameter:Number: It is the number to truncate. decimal_places: It is the number of decimal places truncate to. ReturnsThis function returns the number truncated to a certain number of decimal places. Example 1select truncate(23.458, 2); Output: Example 2select truncate(23.458, -2); Output: Example 3select truncate(2523.458, -2); Output: Example 4select truncate(8653.21,0); Output:
Next TopicMySQL Math
|