TryFloatToCurr - C++ Builder

C++ Builder 参考手册 ➙ System::Sysutils ➙ TryFloatToCurr


浮点型数值转货币型数值

头文件:#include
命名空间:System::Sysutils
函数原型:

bool __fastcall TryFloatToCurr(const System::Extended Value, System::Currency &AResult);

参数:

  • Value:浮点数;
  • AResult:输出转换之后的货币类型数值;

返回值:

  • true:通过参数 AResult 输出转换之后的货币类型数值;
  • false:转换失败,Value 不在货币类型 (System::Currency) 范围,货币类型范围为:-922337203685477.5808 ~ 922337203685477.5807
  • 函数 FloatToCurr 和 TryFloatToCurr 的区别:
    • FloatToCurr 通过函数返回值返回转换结果,如果转换失败抛出 EConvertError 异常;
    • TryFloatToCurr 通过参数返回转换结果,如果转换失败函数返回 false。

相关:

  • System::Sysutils::FloatToCurr
  • System::Sysutils::TryFloatToCurr
  • System::Sysutils::CurrToStr
  • System::Sysutils::CurrToStrF
  • System::Sysutils::FloatToStr
  • System::Sysutils::FloatToStrF
  • 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

C++ Builder 参考手册 ➙ System::Sysutils ➙ TryFloatToCurr

你可能感兴趣的:(TryFloatToCurr - C++ Builder)