ASPチュートリアル

ASPホーム

WPチュートリアル

Webページの紹介 WebPages Razor Webページのレイアウト Webページフォルダ WebPages Global Webページフォーム Webページオブジェクト Webページファイル Webページデータベース Webページヘルパー WebPages WebGrid Webページチャート Webページの電子メール Webページのセキュリティ Webページの公開 Webページの例 Webページクラス

ASP.NET Razor

かみそりのイントロ かみそりの構文 Razor C#変数 Razor C#ループ Razor C#ロジック RazorVB変数 かみそりVBループ RazorVBロジック

ASPクラシック

ASPイントロ ASP構文 ASP変数 ASP手順 ASP条件文 ASPループ ASPフォーム ASPCookie ASPセッション ASPアプリケーション ASP #include ASP Global.asa ASP AJAX ASPメール ASPの例

ASPリファレンス

ASPVB関数 ASPVBキーワード ASP応答 ASPリクエスト ASPアプリケーション ASPセッション ASPサーバー ASPエラー ASPファイルシステム ASP TextStream ASPドライブ ASPファイル ASPフォルダー ASP辞書 ASP AdRotator ASP BrowserCap ASPコンテンツリンク ASPコンテンツローテーター ASPクイック参照

ADOチュートリアル

ADOイントロ ADOコネクト ADOレコードセット ADOディスプレイ ADOクエリ ADOソート ADO追加 ADOアップデート ADO削除 ADO Demo ADOスピードアップ

ADOオブジェクト

ADOコマンド ADO接続 ADOエラー ADOフィールド ADOパラメータ ADOプロパティ ADOレコード ADOレコードセット ADOストリーム ADOデータ型

VBScriptFormatCurrency関数_


❮完全なVBScriptリファレンス

FormatCurrency関数は、コンピューターのコントロールパネルで定義された通貨記号を使用して通貨値としてフォーマットされた式を返します。

構文

FormatCurrency(Expression[,NumDigAfterDec[,
IncLeadingDig[,UseParForNegNum[,GroupDig]]]])

Parameter Description
expression Required. The expression to be formatted
NumDigAfterDec Optional. Indicates how many places to the right of the decimal are displayed. Default is -1 (the computer's regional settings are used)
IncLeadingDig Optional. Indicates whether or not a leading zero is displayed for fractional values:
  • -2 = TristateUseDefault - Use the computer's regional settings
  • -1 = TristateTrue - True
  • 0 = TristateFalse - False
UseParForNegNum Optional. Indicates whether or not to place negative values within parentheses:
  • -2 = TristateUseDefault - Use the computer's regional settings
  • -1 = TristateTrue - True
  • 0 = TristateFalse - False
GroupDig Optional. Indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings:
  • -2 = TristateUseDefault - Use the computer's regional settings
  • -1 = TristateTrue - True
  • 0 = TristateFalse - False

例1

<%

response.write(FormatCurrency(20000))

%>

上記のコードの出力は次のようになります。

$20,000.00

例2

小数点以下の桁数の設定:

<%

response.write(FormatCurrency(20000,2) & "<br />")
response.write(FormatCurrency(20000,5))

%>

上記のコードの出力は次のようになります。

$20,000.00
$20,000.00000

例3

先行ゼロの有無にかかわらず小数値:

<%

response.write(FormatCurrency(.20,,0) & "<br />")
response.write(FormatCurrency(.20,,-1))

%>

上記のコードの出力は次のようになります。

$.20
$0.20

例4

括弧内の負の値かどうか:

<%

response.write(FormatCurrency(-50,,,0) & "<br />")
response.write(FormatCurrency(-50,,,-1))

%>

上記のコードの出力は次のようになります。

-$50.00
($50.00)

例5

百万ドルをグループ化する-またはしない:

<%

response.write(FormatCurrency(1000000,,,,0) & "<br />")
response.write(FormatCurrency(1000000,,,,-1))

%>

上記のコードの出力は次のようになります。

$1000000.00
$1,000,000.00

❮完全なVBScriptリファレンス