使用ASP如何创建带逗号的格式化货币? [英] Using asp how to create formatted currency with commas?

查看:110
本文介绍了使用ASP如何创建带逗号的格式化货币?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用asp.尝试格式化十进制数字以添加逗号.在ASP中是否有简单易用的函数或技术将十进制值转换为带逗号的货币格式?

Using asp. Trying to format a decimal number to add commas. Are there simple to use functions or techniques in asp to go from a decimal value to currency format with commas?

示例:


DecimalValue = 3439.01     CurrencyValue = "    3,439.01"
DecimalValue = 3843838.38  CurrencyValue = "3,843,838.00"

推荐答案

使用vbscript函数FormatCurrency

use the vbscript function FormatCurrency

完整的语法是: FormatCurrency(Expression [,NumDigAfterDec [, IncLeadingDig [,UseParForNegNum [,GroupDig]]]]))

complete syntax is: FormatCurrency(Expression[,NumDigAfterDec[, IncLeadingDig[,UseParForNegNum[,GroupDig]]]])

示例:

FormatCurrency(20000)

输出= $ 20,000.00

output = $20,000.00

设置小数位数的示例:

FormatCurrency(20000,5)

输出= $ 20,000.00000

output = $20,000.00000

这篇关于使用ASP如何创建带逗号的格式化货币?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆