本文整理汇总了C++中Double::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ Double::ToString方法的具体用法?C++ Double::ToString怎么用?C++ Double::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Double
的用法示例。
在下文中一共展示了Double::ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
// Gets a NumberFormatInfo associated with the en-US culture.
CultureInfo^ MyCI = gcnew CultureInfo( "en-US",false );
NumberFormatInfo^ nfi = MyCI->NumberFormat;
// Displays a value with the default separator (S".").
Double myInt = 0.1234;
Console::WriteLine( myInt.ToString( "P", nfi ) );
// Displays the same value with a blank as the separator.
nfi->PercentDecimalSeparator = " ";
Console::WriteLine( myInt.ToString( "P", nfi ) );
}
示例2: main
int main()
{
// Gets a NumberFormatInfo associated with the en-US culture.
CultureInfo^ MyCI = gcnew CultureInfo( "en-US",false );
NumberFormatInfo^ nfi = MyCI->NumberFormat;
// Displays a value with the default separator (S".").
Double myInt = 123456789012345.6789;
Console::WriteLine( myInt.ToString( "P", nfi ) );
// Displays the same value with different groupings.
array<Int32>^mySizes1 = {2,3,4};
array<Int32>^mySizes2 = {2,3,0};
nfi->PercentGroupSizes = mySizes1;
Console::WriteLine( myInt.ToString( "P", nfi ) );
nfi->PercentGroupSizes = mySizes2;
Console::WriteLine( myInt.ToString( "P", nfi ) );
}
示例3: GetErrorMessage
void
ProfileDetailForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
{
result r = E_SUCCESS;
if (pArgs != null)
{
Integer* pId = static_cast< Integer* >(pArgs->GetAt(0));
if (pId == null)
{
MessageBox messageBox;
String getError, getFailGet;
Application::GetInstance()->GetAppResource()->GetString(IDS_ERROR, getError);
Application::GetInstance()->GetAppResource()->GetString(IDS_FAIL_GET, getFailGet);
messageBox.Construct(getError, getFailGet, MSGBOX_STYLE_OK, 0);
int doModal;
messageBox.ShowAndWait(doModal);
AppLogException("[%s] Failed to get Profile.", GetErrorMessage(r));
}
else
{
__currentID = pId->ToInt();
String* pSubjectValue = static_cast< String* >(pArgs->GetAt(1));
if (pSubjectValue == null) {
__pSubjectLabelData->SetText(L"(No subject)");
} else {
__pSubjectLabelData->SetText(*pSubjectValue);
}
Integer* pYear = static_cast< Integer* >(pArgs->GetAt(2));
Integer* pMonth = static_cast< Integer* >(pArgs->GetAt(3));
Integer* pDay = static_cast< Integer* >(pArgs->GetAt(4));
Integer* pHour = static_cast< Integer* >(pArgs->GetAt(5));
Integer* pMinute = static_cast< Integer* >(pArgs->GetAt(6));
String startString;
startString.Format(30, L"%d/%02d/%02d %02d:%02d", pYear->ToInt(), pMonth->ToInt(), pDay->ToInt(), pHour->ToInt(), pMinute->ToInt());
__pStartDateLabelData->SetText(startString);
Integer* pYear2 = static_cast< Integer* >(pArgs->GetAt(7));
Integer* pMonth2 = static_cast< Integer* >(pArgs->GetAt(8));
Integer* pDay2 = static_cast< Integer* >(pArgs->GetAt(9));
Integer* pHour2 = static_cast< Integer* >(pArgs->GetAt(10));
Integer* pMinute2 = static_cast< Integer* >(pArgs->GetAt(11));
String startString2;
startString2.Format(30, L"%d/%02d/%02d %02d:%02d", pYear2->ToInt(), pMonth2->ToInt(), pDay2->ToInt(), pHour2->ToInt(), pMinute2->ToInt());
__pDueDateLabelData->SetText(startString2);
//TODO: Should be modified!!!!
Double* pX = static_cast< Double* > ( pArgs->GetAt(12));
Double* pY = static_cast< Double* > ( pArgs->GetAt(13));
String pointStr = pX->ToString() + " , " + pY->ToString();
__pLocationLabelData->SetText(pointStr);
Integer* pVolume = static_cast< Integer* >(pArgs->GetAt(14));
__pVolumeLabelData->SetText(pVolume->ToString());
Integer* pWifi = static_cast< Integer* >(pArgs->GetAt(15));
__pWifiLabelData->SetText(pWifi->ToInt()==1?"On":"Off");
String* pMemo = static_cast< String* >(pArgs->GetAt(16));
String PropertyValue = L"(No description)";
if (pMemo != null) {
PropertyValue = *pMemo;
}
__pDescriptionLabelData->SetText(PropertyValue);
Invalidate(true);
}
pArgs->RemoveAll(true);
delete pArgs;
}
}