当前位置: 首页>>代码示例>>C++>>正文


C++ Double::ToString方法代码示例

本文整理汇总了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 ) );
}
开发者ID:Ireneph,项目名称:samples,代码行数:15,代码来源:percentdecimalseparator.cpp

示例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 ) );
}
开发者ID:Ireneph,项目名称:samples,代码行数:19,代码来源:percentgroupsizes.cpp

示例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;
	}
}
开发者ID:AhnJihun,项目名称:passion,代码行数:73,代码来源:ProfileDetailForm.cpp


注:本文中的Double::ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。