Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can dbaware controls display the euro currecy?

Status
Not open for further replies.

shelly1977

Programmer
Oct 15, 2003
3
IL
Hi,

I have a problem. I wrote a delphi application with many db controls (such as - dbEdit, dbGrid) which need to display currecncies. For some reason, they don't display the euro currency right.

What is the solution for this?

Thanks, Shelly.
 
What version of Delphi are you using?

What font are you using in your db controls?

How are you trying to display the euro currency sign?

It works for me okay using Delphi 5 and MS Sans Serif with this GetText handler for my cash field;

Code:
procedure TForm1.Table1CashGetText(Sender: TField; var Text: String;
  DisplayText: Boolean);
const
  Euro = #$80;
begin
  Text := Euro + Sender.AsString;
end;

Andrew
 
Towerbase,

First of all, thanks a lot!

Second - I have tried the code you gave me, and it wasn't worked for me as well (I got a line instead of a euro symbol). Then I found out that the problem is that I use "default charset" font in my db controls. When I have changed it to: "easteurope charset" it works fine.

The problem is that now it does not present well other currencies' symbol, and I need it to support some currencies.

The problem is both on Delphi 4 and 6, and I'm tring to present the currency sign by connecting the db control to a data set which contains currency fields.

Thanks again, Shelly.
 
Does the EastEurope character set have the symbols that you need?

How does the dataset represent the different currencies?

Andrew
 
Hi again towerbase,

Let's say I have a dbEdit in my application. It is connected to a dataset that holds a currency field. This means that, automaticly, in run time, the dbEdit presents the value which is written in this field plus a currency symbol, according to the currecy which is defined in windows.

The problem is, that I need my application to support 3 currency symbols: Dollar, euro, and another symbol (I can choose one of them in the windows settings).

The "EastEurope" charset presents well the euro and the dollar symbol, but not the other one. The "defaultCharset" presents well the third one, dollar, but not euro.
 
This seems to be a problem with character sets rather than Delphi.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top