6b5270f341
- Introduced a new helper class `NumberFormatter` with a method `commaToDot` to convert numbers formatted with commas to a dot notation. - The method also trims whitespace and removes percentage signs for cleaner data handling. This commit enhances the application's ability to process numerical data consistently, supporting future financial data operations.
15 lines
301 B
PHP
15 lines
301 B
PHP
<?php
|
|
|
|
namespace App\Helpers;
|
|
|
|
class NumberFormatter
|
|
{
|
|
public static function commaToDot($text)
|
|
{
|
|
$text = trim($text);
|
|
$text = str_replace(".", "", $text);
|
|
$text = str_replace(",", ".", $text);
|
|
$text = str_replace("%", "", $text);
|
|
return $text;
|
|
}
|
|
}
|