C++ Builder 參考手冊(cè) ? System::Sysutils ? FormatCurr
格式化貨幣類型數(shù)值,把貨幣類型數(shù)值按照參數(shù)給定格式轉(zhuǎn)成字符串
頭文件:#include <System.SysUtils.hpp>
命名空間:System::Sysutils
函數(shù)原型:
System::UnicodeString __fastcall FormatCurr(const System::UnicodeString Format, System::Currency Value);
System::UnicodeString __fastcall FormatCurr(const System::UnicodeString Format, System::Currency Value, const TFormatSettings &AFormatSettings);
參數(shù):
- Value:貨幣類型數(shù)值鳍寂;
- Format:格式字符串摇天,與 FormatFloat 函數(shù)的格式相同饼问;
- AFormatSettings:地區(qū)格式,詳細(xì)描述請(qǐng)參考 FloatToStrF呼巴;
返回值:
- 把參數(shù) Value 的值按照參數(shù) Format 的格式轉(zhuǎn)為字符串,與 FormatFloat 函數(shù)的格式相同;
- 地區(qū)格式:這個(gè)函數(shù)使用了地區(qū)格式的 DecimalSeparator 成員作為小數(shù)點(diǎn)寸认、ThousandSeparator 成員作為千位分隔符,不同的地區(qū)可能會(huì)使用不同的字符當(dāng)做小數(shù)點(diǎn)和千位分隔符串慰,中國和大多數(shù)國家一樣使用小圓點(diǎn)作為小數(shù)點(diǎn)偏塞、逗號(hào)作為千位分隔符,但是有的國家 - 例如法國:使用逗號(hào)當(dāng)做小數(shù)點(diǎn)邦鲫、空格當(dāng)做千位分隔符灸叼,如果程序在法國和越南等國家的電腦上運(yùn)行神汹,默認(rèn)情況所有的小數(shù)點(diǎn)都會(huì)使用逗號(hào)的,包括浮點(diǎn)數(shù)和貨幣型古今,程序國際化時(shí)要特別注意屁魏;
- 如果有 AFormatSettings 參數(shù),使用這個(gè)參數(shù)的格式捉腥;
- 如果沒有 AFormatSettings 參數(shù)氓拼,使用 全局變量 System::Sysutils::FormatSettings 作為地區(qū)格式;
- AFormatSettings 或 System::Sysutils::FormatSettings 的例子請(qǐng)參考 FloatToStrF
- 沒有 AFormatSettings 參數(shù)的函數(shù)不是線程安全的抵碟,因?yàn)槭褂昧巳肿兞孔鳛槟J(rèn)的地區(qū)格式桃漾;帶有 AFormatSettings 參數(shù)的函數(shù)是線程安全的。
相關(guān):
- System::Sysutils::FloatToStr
- System::Sysutils::FloatToStrF
- System::Sysutils::FloatToText
- System::Sysutils::FloatToTextFmt
- System::Sysutils::FloatToDecimal
- System::Sysutils::FloatToCurr
- System::Sysutils::TryFloatToCurr
- System::Sysutils::TextToFloat
- System::Sysutils::StrToFloat
- System::Sysutils::StrToFloatDef
- System::Sysutils::TryStrToFloat
- System::Sysutils::StrToCurr
- System::Sysutils::StrToCurrDef
- System::Sysutils::TryStrToCurr
- System::Sysutils::CurrToStr
- System::Sysutils::CurrToStrF
- System::Sysutils::FormatFloat
- System::Sysutils::FormatCurr
- System::Sysutils::TFloatRec
- System::Sysutils::TFloatValue
- System::Sysutils::FormatSettings
- System::Sysutils::TFormatSettings
- System::Sysutils::StrToBool
- System::Sysutils::StrToBoolDef
- System::Sysutils::TryStrToBool
- System::Sysutils::BoolToStr
- System::Sysutils::DateTimeToStr
- System::Sysutils::DateTimeToString
- System::Sysutils::DateToStr
- System::Sysutils::GUIDToString
- System::Sysutils::IntToStr
- System::Sysutils::IntToHex
- System::Sysutils::TimeToStr
- System::Sysutils::UIntToStr
- System::Sysutils
- System::Currency
- System
- std::itoa, std::_itoa, std::_itot, std::_itow
- std::ltoa, std::_ltoa, std::_ltot, std::_ltow
- std::ultoa, std::_ultoa, std::_ultot, std::_ultow
- std::_i64toa, std::_i64tot, std::_i64tow
- std::_ui64toa, std::_ui64tot, std::_ui64tow
- std::ecvt, std::_ecvt
- std::fcvt, std::_fcvt
- std::gcvt, std::_gcvt
- <cstdlib>
C++ Builder 參考手冊(cè) ? System::Sysutils ? FormatCurr
`