[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Problem with numbers in French on a Delphi program

Posted on 2006-05-24
3
Medium Priority
?
228 Views
Last Modified: 2010-04-05
Hello,

I have a program with a combo box that has decimal values from .40 to 1.0.  A user selects this as a selling multiplier for products.  If you select .60 in the combo box, then another edit box displays the selling multiplier at four decimal places, (.6000 in this case.)  

This works great in English.  But if the user changes the Regional Setting to French(Canada) in the Control Panel, I run into problems.  Now, when you select .60 in the box, 60,0000 shows up in the selling mulitplier edit box.  It's as if it's disregarding the decimal in the combo box.

Any ideas on how I can resolve this?

Thanks!
0
Comment
Question by:light_bulb
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
Jacco earned 1500 total points
ID: 16755744
Hi there,

This should solve you problem:

const
  USAFormat: TFormatSettings = (
    DecimalSeparator: '.'
  );

procedure TForm1.ComboBox1Change(Sender: TObject);
var
  lnNumber: Double;
begin
  if ComboBox1.ItemIndex = -1 then
    lnNumber := 0
  else
    lnNumber := StrToFloat(ComboBox1.Text, USAFormat);
  Edit1.Text := FloatToStrF(lnNumber, ffFixed, 15, 4);
end;

Regards Jacco
0
 
LVL 3

Author Comment

by:light_bulb
ID: 16755780
Not sure if that will work or not, I've since found an answer myself.  I had to clear the combo and then repopulate it, replaceing the decimal points with commas.

Thanks though.
0
 
LVL 10

Expert Comment

by:Jacco
ID: 16758241
Hi there,

That is the other option. Thanks for the points though.

Regards Jacco
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month18 days, 14 hours left to enroll

834 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