Files
finance/app/Helpers/NumberFormatter.php
Ümit Tunç 6b5270f341 Add NumberFormatter helper class for number formatting
- 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.
2025-01-17 23:06:55 +03:00

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;
}
}