1. Make sure you have a locale with thousand delimiter set to a dot (like pl_PL) via locale -a.
2. Switch your monetary locale to that value.
3. Edit two event fees, one to 40,00 and the other to 12,34
4. Test drive both events.
Result: civicrm_participant.fee_amount values are right in both cases, but civicrm_contribution.fee_amount values are 40.00 (right) and 12.34 (wrong).
This is because if the thousand delimiter is a dot, the first call changes 12,34 to 12.34 and the second call turns it into 1234