Using a react-intl FormattedNumber component, we'll pass a Number and a few additional props in order to render the correct separator and currency symbols for different languages.

For example we have price data as such:

        "price": {
"en-US": "16.19",
"es-ES": "15.09",
"fr-FR": "15.09"
},

We can use FormattedNumber  to display the correct currency.

let locale = (navigator.languages && navigator.languages[0])
|| navigator.language
|| navigator.userLanguage
|| 'en-US'; <p>
<FormattedNumber
style='currency'
currency={locale === 'en-US' ? 'USD': 'EUR'}
currencyDisplay='symbol'
value={merchant.price[locale]} />
</p>

最新文章

  1. 在Extjs中对日期的处理,以及在后端数据在SQL语句的判断处理
  2. windows 平台 php_Imagick 拓展遇到的那些坑!
  3. Linux SHELL 命令入门题目答案(一)
  4. _stdcall,_cdecl区别
  5. scrot使用
  6. 【BZOJ】1135: [POI2009]Lyz
  7. Spine批量导出Command line Export
  8. PHP 运行方式(PHP SAPI介绍)
  9. 关于updateElement接口
  10. python开发_mysqldb安装
  11. Win7下 httpRequest带证书请求https网站
  12. [Irving] SQL 2005/SQL 2008 备份数据库并自动删除N天前备份的脚本
  13. web版扫雷小游戏(四)
  14. 读书笔记—CLR via C#字符串及文本
  15. 解决 win10飞行模式 无限自动开关 无法关闭
  16. 【读书笔记】iOS-自定义 URL Scheme 完全指南
  17. WinAPI Hook
  18. spring-IOC容器(一)
  19. 低版本系统兼容的ActionBar(七)自定义Actionbar标题栏字体
  20. H5特性回顾

热门文章

  1. 游戏server之server优化思路
  2. 52. nodejs报错:Cannot find module &#39;ejs&#39;
  3. 14.字符串hash寻找第一个只出现一次的字符
  4. Impala与HBase整合
  5. Codefroces 415B Mashmokh and Tokens
  6. 2017国家集训队作业[agc006e]Rotate 3x3
  7. spring mvc 接收ajax 复杂结构数据
  8. aop 中joinpoint的使用方法
  9. start_kernel----lcokdep_init
  10. POJ 3461 Oulipo KMP算法题解