Hi, you may consider using the following code.
As PHP derives heavily from C, it has a number of functions and behaviours that are similar/identical.
One function of use is sscanf, which allows you to scan a string for particular types of data. You can grab strings, numbers and characters for instance. In my understanding, neither C nor PHP's sscanf function were designed to use decimal separators other than a period. Also,they're not designed for use with thousands-separators either.
With this in mind, we can go about transforming the string into something that sscanf will handle. We can then grab it as a floating-point number and perform mathematical operations on it. We can then finally convert this number back into a string representation, even being able to specify which character is used for both types of separator.
<?php
$inputStr = '34.000.000,23';
echo $inputStr . '<br>';
$numberStr = str_replace('.', '', $inputStr);
$numberStr = str_replace(',', '.', $numberStr);
sscanf($numberStr, '%f', $number);
$number *= 2;
$outputStr = number_format($number, 2, ',', '.');
echo $outputStr . "<br>";
?>
Output
34.000.000,23
68.000.000,46