Solved

Rechnen mit Double Werten

Posted on 2000-02-17
5
206 Views
Last Modified: 2013-12-26
Hi Experts,

Warum werden in diesem Fall
meine Nachkommastellen einfach nicht
berücksichtigt. Weder bei der Berechnung noch bei der Ausgabe.

grid.Text =
Format(dSummPorto + dSummBearb, "##,##0.00 DM")

dSummPorto = 44,80
sSummBearb = 48,00
Ausgabe =    92,00 statt 92,80
 
Beide Variablen sind als Double deklariert.

MFG
Jörg

0
Comment
Question by:blackjack020900
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2531505
Hallo,

Ich bin nicht sicher aber Ich denke das grid (von grid.text) ein DataGrid ist.

In diesen Fall sollte man bei Properties -> tab Format eine Custom Format wahlen (deine Format string). Möchtest du ein Format in Code haben, dann must du das machen mit:

DataGrid1.Columns(index).NumberFormat = "##,##0.00 DM"

Entsculdige fur mein slechtes Deutsch.

Now in English, because I think most Experts do know English and only few of them know German:

When you try to format a value and assign it to a cell in a grid, it won't come through. You'll have to use code like this:

DataGrid1.Columns(index).NumberFormat = "##,##0.00 DM"

or set the format property for the approriate column to the correct value, using the property page
0
 

Author Comment

by:blackjack020900
ID: 2531583
Leider ist es ein MSFlexGrid.

Um den Text einer Zelle zu Bearbeiten,
konvertiere mit der Val-Funktion, was
nicht funktionieren kann, da die Daten in der Datenbank mit einem Komma als Trennzeichen gespeichert sind.

Die CDbl-Funktion nimmt er mir gar nicht an.

Ich bin etwas ratlos!

MFG
Jörg
0
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 2532047
In dieser Fall must du sorgen das die komma ein punkt wird.

Ich hoffe du kannst mir verzeihen, aber Ich mus jetzt gehen...

Bis spater
0
 
LVL 2

Accepted Solution

by:
p_biggelaar earned 50 total points
ID: 2532049
p_biggelaar changed the proposed answer to a comment
0
 

Author Comment

by:blackjack020900
ID: 2558180
Danke.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question