setTimestamp(intval($match[1])); return $date->format('d/M/Y H:i:s'); } /** * Takes amount object in Taler format, and converts it * in a human-readable string. NOTE: Taler amounts objects * come from JSON of the form: * '{"value" x, "fraction": y, "currency": "CUR"}' */ function get_amount($taler_amount){ $PRECISION = 100000000; $fraction = $taler_amount->fraction / $PRECISION; $number = $taler_amount->value + $fraction; return sprintf("%s %s", $number, $taler_amount->currency); } ?>