Solved

Rechnen mit Double Werten

Posted on 2000-02-17
5
203 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now