Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

double in CString/string konvertieren

Empfohlene Antworten

Veröffentlicht

Hallo @all,

kann mir einer ne Möglichkeit nennen, wie ich einen Double-Wert in einen CString oder string konvertieren kann??

Wäre für jeden Tipp echt dankbar!!

Danke + Gruß

Kitty

habe zwar schon in google geschaut, jedoch habe ich probleme mit meinem explorer. er öffnet mir gar keine seite, wenn ich auf irgend einen link klicke. hier im forum hab ich auch shcon gesucht + nix gefunden und im forum bei www.c-plusplus.de geht die suchfunktion nicht richtig. Was ist nun mit 10x schneller? :rolleyes:

stehe also jetzt immernoch vorm gleichen problem. habe zwar eine Lösung gefunden, aber es gibt sicher etwas eleganteres: :confused:

erst sprintf und dann von char-array in string konvertieren und vom string nach CString konvertieren.

Gruß Kitty

CString.Format("%d", doubleVariable);

ah danke , das geht! :)

Gruß Kitty

  • 2 Wochen später...

Hallo,

ich glaube hier stimmt was nicht. Wenn du wirklich eine double-Zahl in einen CString umwandeln willst muss das so passieren:


double doubleZahl = 0.4545;
CString str;
str.Format("%f", doubleZahl);
[/PHP]

Laut MSDN ist "%d" nur für integers zuständig! In meinem Testprogramm hatte der CString nach dem Format-Aufruf auch einen fehlerhaften Wert wenn anstatt "%f" "%d" im Format-String verwendet wurde (Zu beachten: Der Test erfolgte mit einer Komma-Zahl also 0.4545).

Gruss

mep

  • 5 Monate später...
Also manchmal isses wirklich seltsam, dass sich manch einer die Mühe macht hier ein Posting zu erstellen, wo Tante Google 10x schneller ist:

http://www.google.com/search?hl=de&q=%22Double+in+CString%22&lr=

Dein Beitrag erzeugt Rekursion die zu einem Stack-overflow führen kann.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.