modStrTools 函式庫 風禹科技驗證有限公司 網站 提供 .Net 原始碼

myFormatNumeric 函數

說明

自訂數值格式

本函數之引數列表

引數 型態 位元組 選項 預設值 說明
vData Variant - 必須 (無) 欲格式化之數值資料
strFormat String - 必須 (無) 格式字串,若為空字串則傳回原數值

傳回值

傳回格式字串

範例

Response.Write myFormatNumeric(12345.6789, "#,##0.000") ' 傳回 12,345.679
Response.Write myFormatNumeric(123.456789, "#,##0.000") ' 傳回 123.457

更進一步

目前本函數仍有未處理之錯誤,例如 0,000 的格式下,會不處理 , 的情形,由於站長轉換到 ASP.NET 去,原則上此問題將不去處理,請參照使用的網友自行修改。

基本條件

Internet Information Server 4.0 以後 | StrTools.asp

請參閱

modStrTools 函式庫