-1

書式通貨「.」を変更する方法 to ',' asp.net MVC4 ex: 10,000 thay cho 10.000 私はファイルテンプレート @Model.ToString("n0") を持っています

4

2 に答える 2

0

このリンクを見てください:

http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencygroupseparator.aspx

数値形式を指定してサンプルコードと出力を変更し、CurrencyGroupSeparator

using System;
using System.Globalization;

class NumberFormatInfoSample {

   public static void Main() {

      // Gets a NumberFormatInfo associated with the en-US culture.
      NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;

      // Displays a value with the default separator (",").
      Int64 myInt = 123456789;
      Console.WriteLine( myInt.ToString( "N0", nfi ) );

      // Displays the same value with a specified separator.
      nfi.CurrencyGroupSeparator = ".";
      Console.WriteLine( myInt.ToString( "N0", nfi ) );

   }
}


/* 
This code produces the following output.

123,456,789
123.456.789
*/
于 2013-07-03T07:46:54.837 に答える