私はlog4netを使って書式付きメッセージを出力しています。次のコードString.Formatとlog.DebugFormat通貨
で
log.DebugFormat("Balance: {0:c} ", balance);
結果「バランス:¤1,000.00」
はなぜ奇妙なキャラクターが、私はとは何かであることを想像$
私はlog4netを使って書式付きメッセージを出力しています。次のコードString.Formatとlog.DebugFormat通貨
で
log.DebugFormat("Balance: {0:c} ", balance);
結果「バランス:¤1,000.00」
はなぜ奇妙なキャラクターが、私はとは何かであることを想像$
出現していませんあなたの地域の設定。
このような何か試してみてください:
System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat:そのdosen'tの仕事は、あなたはいつもの価値を確認するために、デバッガを使用できる場合
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(<your culture setting>);
log.DebugFormat("Balance: {0:c} ", balance);
を;それは「$」記号に設定されますことを確認するために
ansiCurrencySymbol
:
は、具体的の値を確認します。
ます。また、このウィキペディアのページでinterstedてすることができる:http://en.wikipedia.org/wiki/Currency_%28typography%29あなたが取得しているシンボルが何であるかを説明し
。
は、具体的に:
The currency sign (¤) is a character used to denote a currency, when the symbol for a particular currency is unavailable.
It is particularly common in place of symbols, such as that of the Colón (₡), which are absent from most character sets and fonts.
It can be described as a circle the size of a lowercase character with four short radiating arms at 45° (NE), 135° (NW), 225°, (SW) and 315° (SE). It is slightly raised over the baseline.
It is represented in Unicode, as CURRENCY SIGN (U+00A4). In HTML, the character entity reference ¤ or numeric character reference ¤ may be used.
それを試して、同じ結果を得ました – Striker
はあなたのコンピュータ上の領域の設定を確認しましたか? – Stephan
どこにログインしていますか? –
私は実際にはlog4netと関係があると思います、これは期待どおりに動作するからです。 log.Debug(String.Format( "残高:{0:C}"、残高)); – Striker