全球公认的国际货币显示方式是什么?
\n\n例如:20 美元、20 美元、20 美元(美国)、\xe2\x82\xac20、20\xe2\x82\xac 等?
\n\n如果有多种显示每种货币的方法,那么显示货币的通用方法是什么?
\n我发现了 Money gem 的这个附加组件,它从 ECB 欧洲中央银行更新(每 24 小时更新一次汇率),但我不确定应该如何在使用多种货币的 Rails 应用程序中进行缓存。
http://github.com/RubyMoney/eu_central_bank
eu_bank ||= EuCentralBank.new
eu_bank.update_rates
#Rails.cache.fetch('rates', :expires_in => 24.hours) { eu_bank.update_rates }
rate = eu_bank.exchange_with(Money.new(100, session[:currency]), "USD").to_f
Run Code Online (Sandbox Code Playgroud)
它有一个功能可以将费率写入某个文件......但我也不确定这就是我想要的。我还使用具有只读文件系统的heroku。
eu_bank.save_rates("/some/file/location/exchange_rates.xml")
Run Code Online (Sandbox Code Playgroud)
我也找不到任何方法来检查该物体的年龄。我只是想知道每 24 小时加载一次并持续用于我的整个 Rails 应用程序的最佳选择。有什么指点吗?
来自维基百科:
印度编号系统使用与国际规范不同的分隔符。与国际系统中将数字按三位数分组不同,它将最右边的三位数字分组在一起(直到百位),然后按一组两位数字分组。因此,一万亿将被写为 10,00,00,00,00,000。
toLocaleStringJavaScript 的函数以正确的en-IN语言环境格式返回。
(123456789).toLocaleString('en-IN', {
style: 'currency',
currency: 'INR',
minimumFractionDigits: 2,
maximumFractionDigits: 2
}) // ? 12,34,56,789.00
Run Code Online (Sandbox Code Playgroud)
但是 Angular 的货币管道不会为en-IN语言环境返回相同的输出。我需要创建自定义管道吗?
{{ 123456789 | currency : 'INR' : 'symbol': '1.2-2' : 'en-IN' }}
<!-- ?123,456,789.00 -->
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 component.ts 文件中使用此货币管道。但不会产生相同的结果。
{{ money |currency: 'EUR': 'symbol' : '' : locale}}
this.currencyPipe.transform(money, 'EUR', '', true);
Run Code Online (Sandbox Code Playgroud) 对于excelJs,numFmt对于美元来说效果很好,但是无法弄清楚如何格式化日元的数字。
\n\n有效的美元格式:\'$#,##0.00\'
\n\n// works just fine\n//\nstyle : {\n numFmt : \'$#,##0.00\'\n}\nRun Code Online (Sandbox Code Playgroud)\n\n我尝试过的日元格式:\'\xc2\xa5#,##0.00\' / \'\xc2\xa5#,##0\'但不成功
\n\n// doesn\'t work\n//\nstyle : {\n numFmt : \'\xc2\xa5#,##0.00\'\n}\n\nstyle : {\n numFmt : \'\xc2\xa5#,##0\'\n}\nRun Code Online (Sandbox Code Playgroud)\n\n当我尝试将单元格设置为日元格式时,我总是从电子表格中收到错误,无法导入数据格式。提前致谢!
\n我目前正在执行一项任务,涉及获取代表一笔钱的双精度数字,并使用 NumberFormat 类的 getCurrencyInstance 方法将其转换为美国、印度、中国和法国的货币格式。
\n输入:
\nA single double-precision number denoting 'payment'\nRun Code Online (Sandbox Code Playgroud)\n输出:
\nOn the first line, print US: 'u' where 'u' is 'payment' formatted for US currency.\nOn the second line, print India: 'i' where 'i' is 'payment' formatted for the Indian currency.\nOn the third line, print China: 'c' where 'c' is 'payment' formatted for Chinese currency.\nOn the fourth line, print France: 'f' where 'f' is formatted for French currency.\nRun Code Online (Sandbox Code Playgroud)\n输入示例:
\n12324.134\nRun Code Online (Sandbox Code Playgroud)\n示例输出: …
在我正在使用的ASP.Net网站中
String.Format("{0:C}", param)
Run Code Online (Sandbox Code Playgroud)
格式化货币值.在我的本地机器上这很好用,但是当将网站部署到服务器时,输出从€切换到$.
显然服务器有不同的文化设置,是否有一种简单的方法来改变这个应用程序?(无法直接访问服务器设置)
我可以更改web.config条目吗?
我正在尝试将PayPal实施到我们的网站中。我使用cURL与PayPal的Express Checkout API进行交互。该网站本质上是德语的,因此付款将以欧元结算。
我执行了cURL,API返回了一个错误。我发现我$price是导致错误的原因。
默认情况下,$price = 56,85使用这些值,PayPal的API返回错误。但是,如果将其更改为$price = 56.85API,则会成功。
我可以简单地使用str_replace逗号替换句点。但是让我担心的是产品的价格。我正在用欧元交易。
有谁在乎解释我该如何处理这个问题?
我是PHP的新手所以我不确定我做错了什么,但似乎只有最后一句如果声明正在执行,无论我选择哪种货币,美元兑换美元.
我需要这样做才能转换我选择的FROM和TO货币,转换会显示在amount_output框中.并且我输入的货币和挂载仍保留在结果中而不会重置.
任何帮助它非常感谢.
<?php
$amount_input = filter_input(INPUT_POST, 'amount_input');
$currency1 = filter_input(INPUT_POST, 'currency1');
$currency2 = filter_input(INPUT_POST, 'currency2');
if ($currency1="CAD" AND $currency2="CAD")
{
$amount_output = $amount_input*1.0;
}
if ($currency1="CAD" AND $currency2="EUR")
{
$amount_output = $amount_input*0.624514066;
}
if ($currency1="CAD" AND $currency2="GBP")
{
$amount_output = $amount_input*0.588714763;
}
if ($currency1="CAD" AND $currency2="USD")
{
$amount_output = $amount_input*0.810307;
}
if ($currency1="EUR" AND $currency2="CAD")
{
$amount_output = $amount_input*1.601244959;
}
if ($currency1="EUR" AND $currency2="EUR")
{
$amount_output = $amount_input*1.0;
}
if ($currency1="EUR" AND $currency2="GBP")
{
$amount_output = $amount_input*0.942676548;
}
if …Run Code Online (Sandbox Code Playgroud) 我正在使用格式:
type ="$ ###,###,## 0.00"
用于货币并将格式类型分配给工作表单元格
例如.
wrkSheet.Cells[0].Style.Numberformat.Format = formatType;
但是这是在excel中作为文本类型插入的.我希望将其作为货币或数字插入,以便继续对插入的值(排序,总和等)进行分析.
目前,因为它是文本类型验证不正确.有没有办法强制可以插入格式化值的类型?