473,320 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem with Euro formatting

The system I support exists to generate invoices to send to European
clients. Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: €123.456,78

We have been generating these by remoting in to a dedicated PC with
its Windows Regional setting set to German. For various reasons we
would much prefer not to have to do this.

I've been trying to devise a format string that will display a number
in the format shown above on a PC with Regional setting set to US.
I'm not having luck. Has anyone succeeded in doing this?

TIA,

Bruce
Access 2003, Win XP
Oct 16 '08 #1
7 6469
On Thu, 16 Oct 2008 14:46:26 -0700 (PDT), br********@comcast.net
wrote:

It may be best to write your own ConvertToEuro function, using regular
string manipulation functions. RegEx gurus may have other options.

-Tom.
Microsoft Access MVP

>The system I support exists to generate invoices to send to European
clients. Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: €123.456,78

We have been generating these by remoting in to a dedicated PC with
its Windows Regional setting set to German. For various reasons we
would much prefer not to have to do this.

I've been trying to devise a format string that will display a number
in the format shown above on a PC with Regional setting set to US.
I'm not having luck. Has anyone succeeded in doing this?

TIA,

Bruce
Access 2003, Win XP
Oct 17 '08 #2
On Oct 16, 11:24*pm, Tom van Stiphout <tom7744.no.s...@cox.netwrote:
On Thu, 16 Oct 2008 14:46:26 -0700 (PDT), brucedo...@comcast.net
wrote:

It may be best to write your own ConvertToEuro function, using regular
string manipulation functions. RegEx gurus may have other options.

-Tom.
Microsoft Access MVP
The system I support exists to generate invoices to send to European
clients. *Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: €123.456,78
We have been generating these by remoting in to a dedicated PC with
its Windows Regional setting set to German. *For various reasons we
would much prefer not to have to do this.
I've been trying to devise a format string that will display a number
in the format shown above on a PC with Regional setting set to US.
I'm not having luck. Has anyone succeeded in doing this?
TIA,
Bruce
Access 2003, Win XP
Thanks for the suggestion. Do you mean building a string for display,
rather than using Format() to format the number?
Oct 17 '08 #3
On Fri, 17 Oct 2008 03:40:43 -0700 (PDT), br********@comcast.net
wrote:

That's right. I read the details of the Format function, and it cannot
switch the thousand separator or the decimal point. Therefore the
suggestion to just write the darn thing yourself.

-Tom.
Microsoft Access MVP

>On Oct 16, 11:24*pm, Tom van Stiphout <tom7744.no.s...@cox.netwrote:
>On Thu, 16 Oct 2008 14:46:26 -0700 (PDT), brucedo...@comcast.net
wrote:

It may be best to write your own ConvertToEuro function, using regular
string manipulation functions. RegEx gurus may have other options.

-Tom.
Microsoft Access MVP
>The system I support exists to generate invoices to send to European
clients. *Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: €123.456,78
>We have been generating these by remoting in to a dedicated PC with
its Windows Regional setting set to German. *For various reasons we
would much prefer not to have to do this.
>I've been trying to devise a format string that will display a number
in the format shown above on a PC with Regional setting set to US.
I'm not having luck. Has anyone succeeded in doing this?
>TIA,
>Bruce
Access 2003, Win XP

Thanks for the suggestion. Do you mean building a string for display,
rather than using Format() to format the number?
Oct 17 '08 #4
On Oct 17, 9:23*am, Tom van Stiphout <tom7744.no.s...@cox.netwrote:
On Fri, 17 Oct 2008 03:40:43 -0700 (PDT), brucedo...@comcast.net
wrote:

That's right. I read the details of the Format function, and it cannot
switch the thousand separator or the decimal point. Therefore the
suggestion to just write the darn thing yourself.

-Tom.
Microsoft Access MVP
On Oct 16, 11:24*pm, Tom van Stiphout <tom7744.no.s...@cox.netwrote:
On Thu, 16 Oct 2008 14:46:26 -0700 (PDT), brucedo...@comcast.net
wrote:
It may be best to write your own ConvertToEuro function, using regular
string manipulation functions. RegEx gurus may have other options.
-Tom.
Microsoft Access MVP
The system I support exists to generate invoices to send to European
clients. *Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: €123.456,78
We have been generating these by remoting in to a dedicated PC with
its Windows Regional setting set to German. *For various reasons we
would much prefer not to have to do this.
I've been trying to devise a format string that will display a number
in the format shown above on a PC with Regional setting set to US.
I'm not having luck. Has anyone succeeded in doing this?
TIA,
Bruce
Access 2003, Win XP
Thanks for the suggestion. *Do you mean building a string for display,
rather than using Format() to format the number?- Hide quoted text -

- Show quoted text -
Well, it's better to know. Thanks.
Oct 17 '08 #5
Sky
<br********@comcast.netwrote in message
news:0d**********************************@y79g2000 hsa.googlegroups.com...
The system I support exists to generate invoices to send to European
clients. Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: €123.456,78
How about something like this:

"€" &
Replace(Replace(Replace(Format(123456.78,"#,###.00 "),".","_"),",","."),"_",",")

which displays as €123.456,78

- Steve
Oct 17 '08 #6
Sky
"Sky" <s.young @ stanley associates . comwrote in message
news:4B****************@nwrddc01.gnilink.net...
<br********@comcast.netwrote in message
news:0d**********************************@y79g2000 hsa.googlegroups.com...
>The system I support exists to generate invoices to send to European
clients. Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: ?123.456,78

How about something like this:

"?" &
Replace(Replace(Replace(Format(123456.78,"#,###.00 "),".","_"),",","."),"_",",")

which displays as ?123.456,78

- Steve
Oops, the Euro symbol got converted to a question mark, but you get the
idea.

- Steve
Oct 17 '08 #7
Try

Public Function CashToEuro(Amount As Currency) As String

Dim TxtAmount As String
Dim i As Integer, j As Integer
Dim OverThousand As Boolean

TxtAmount = CStr(Amount)
i = InStr(TxtAmount, ".")
If i 0 Then ' Decimal found
TxtAmount = Left(TxtAmount, i - 1) & "," & Right(TxtAmount,
Len(TxtAmount) - i)
If Len(TxtAmount) 6 Then ' Over 1000
OverThousand = True
End If
End If

If i = 0 Then ' No Decimal
TxtAmount = TxtAmount & ",00"
If Len(TxtAmount) 3 Then ' Over 1000
OverThousand = True
End If
End If

If OverThousand = True Then
i = InStrRev(TxtAmount, ",") ' Find the decimal point
i = i - 4
TxtAmount = Left(TxtAmount, i) & "." & Right(TxtAmount,
Len(TxtAmount) - i)
End If

CashToEuro = Chr(128) & TxtAmount

End Function
You will probably need to right align the output field

Phil
"Sky" <s.young @ stanley associates . comwrote in message
news:TC*****************@nwrddc01.gnilink.net...
"Sky" <s.young @ stanley associates . comwrote in message
news:4B****************@nwrddc01.gnilink.net...
><br********@comcast.netwrote in message
news:0d**********************************@y79g200 0hsa.googlegroups.com...
>>The system I support exists to generate invoices to send to European
clients. Currency values in these reports must be represented as
Euros with European conventions (comma for decimal; dot for thousands
separator). Example: ?123.456,78

How about something like this:

"?" &
Replace(Replace(Replace(Format(123456.78,"#,###.0 0"),".","_"),",","."),"_",",")

which displays as ?123.456,78

- Steve

Oops, the Euro symbol got converted to a question mark, but you get the
idea.

- Steve


Oct 20 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: christine | last post by:
Hello, I wanted to create a currency translator with PHP. The code looks like this: <?php $faktor=2.95583; // a double $dm = $euro * $faktor; // $euro is a double variable with the...
1
by: AngTalunin | last post by:
Hey, I've got a problem with utf-8 strings. I start with getting a string from a database and when i encode it with utf8Encode($str) and output it to the browser (which has a utf-8 encodig),...
2
by: SPG | last post by:
Hi, I am haveing some problems with getting the correct XML response from a Servlet. I have data that contains the euro sign ( 0x80 = ?) and the string I am trying to print out to the response...
1
by: Damjan | last post by:
Hi All, I have just spent 2 days tring to display euro sign in html which is obtained from xml and xsl. After you would not beleive what kind of research it came down to that when I load the...
18
by: gabriel | last post by:
greetings, I am currently working on a website where I need to print the Euro symbol and some "oe" like in "oeuvre". If I choose this : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
0
by: ashish | last post by:
hi All, Iam having a webapplication which when run under French culture info displays value of euro currency in this format 0.00 E, (E being the euro symbol, dont know how to type it here ) ...
8
by: Max | last post by:
My client has decided to use the Euro for the entire web site. Is there an easy way to get my ASP.NET app to format currency to Euro instead of US-dollar? Right now it's just reading the server...
7
by: kingski | last post by:
Any idea about this ? http://www.developerfusion.co.uk/forums/thread/114379/#114379 "Can any one help me as i am building a shopping cart and it supports multiple currencies but while sending...
3
by: Georg Weiler | last post by:
Hi, I have a database PostgreSQL entry that includes the string € which is the euro sign. When I retrieve the string through a PHP SQL statement and then echo the result to the browser, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.