Maybe I forund a solution. It would be nice, if you, Steve, or someone else could confirm my solution as the right way to do it.
Thanks :)
In the table class I added the following functions:
function fieldname__pushValue($record, $el){
$val = $el->getValue();
$val = str_replace(",", ".", $val);
$val = number_format(floatval($val), 2, ".", ",");
if ( $val !== false ){
return $val;
}
return null;
}
function fieldname__pullValue($record, $el){
$val = $record->val('fieldname');
$val = number_format(floatval($val), 2, ",", ".");
return $val;
}
So I can enter "1,25" and get 1.25 in the database. Editing this field gets me the "1,25" again. Very nice.
Is this the right way to do it with xataface?
Thanks in advance.
Best regards
Richard