dougu2240 2010-07-23 15:46
浏览 19
已采纳

PHP> Zend框架> Zend_Money

I've used Zend_Money to format currency as follow

$currency = new Zend_Currency(array('value' => $money,
                                    'currency' => 'CAN', 
                                    'format' => 'fr'));

// output -> 100,00 $

Which display normally on my local development system (wamp on windows)

But when i put it online on my testing server (apache on windows (not my choice and i can't change it :( ), the code output becomes

// output -> 100,00 €

I would like to know if someone has ever encountered such issue and where i need to look to find the solution

Thanks

  • 写回答

2条回答 默认 最新

  • duanhong4274 2010-08-05 15:12
    关注

    Thanks a lot it goes in the same direction as the solution I choose. I've put a new key in my config file

    variable.locale = "fr_CA"
    

    Which is then initiated in the bootstrap as the global locale for the whole application

    protected function _initLocale(){
        $variables = Zend_Registry::get('config')->variable;
        $locale = new Zend_Locale($variables->locale);
        Zend_Registry::set('Zend_Locale', $locale);
    }
    

    I already have a config key initiated from a previous method in the bootstrap

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 Java-Oj-桌布的计算
  • ¥15 请问如何在openpcdet上对KITTI数据集的测试集进行结果评估?
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路