Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problemas com Pattern #23

Open
faustort opened this issue Feb 20, 2014 · 0 comments
Open

Problemas com Pattern #23

faustort opened this issue Feb 20, 2014 · 0 comments

Comments

@faustort
Copy link

Para resolver realizei a seguinte alteração no seu código:
(Claro que esta solução é bem simples, não possuo tamanho conhecimento em Expressões Regulares que daríam um melhor código, mas este serve e funciona)

xml.php => 275
$xmlItem->addChild('shippingCost', '0.00'); // removi o (double)

xml.php => 385
protected function _formatNumberToXml($value = 0.00)
{
if($value == 0){
return "0.00";
}

    $value = (double) number_format($value, 2, '.', '');

    $nums = explode(".", $value);
    if($nums[0] == "00"){
        return 0 . "." . $nums[1];
    }

    return $value ;
}

Espero ter ajudado.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant