Howto write a number in English

  • Thread starter Thread starter Veli Izzet
  • Start date Start date
V

Veli Izzet

Hi all,

I need to print the invoice total "IN ENGLISH" on a report.

i.e. If the invoice total is 30.50, There must be a line which says
"Thirty dollars and fifty cents".

Any help in this venue?

Thanks for answers,
 
Veli Izzet said:
Hi all,

I need to print the invoice total "IN ENGLISH" on a report.

i.e. If the invoice total is 30.50, There must be a line which says
"Thirty dollars and fifty cents".

Any help in this venue?

This is probably what you want:

http://www.mvps.org/access/modules/mdl0001.htm
Modules: Convert Currency ($500) into words (Five Hundred Dollars)

That web site, the Access Web (www.mvps.org/access), is a good place to
start your search for any common "how-to" question.
 
Yes it is.
Now comes the part where I need to do the translation to Turkish....
 
Veli Izzet said:
Yes it is.
Now comes the part where I need to do the translation to Turkish....

You've got me there! But maybe you can just translate the relevant
strings in the function code.
 
This is what I will try.

We do not have a problem with teens, eleven, twelve and thirteen, but we
do not say one hundred or one thousand, it is hundred and thousand, but
two hundred and two thousand. etc but one million is one million.
I'll see.
 
Dirk,

I accomplished everything except for one:

1000 is not ONE THOUSAND but THOUSAND (ONE DROPS). Do you know if the
author is around here so I can ask, or can you see a quick solution with
that particular code.
 
It is done, crudely, but it works.


Veli said:
Dirk,

I accomplished everything except for one:

1000 is not ONE THOUSAND but THOUSAND (ONE DROPS). Do you know if the
author is around here so I can ask, or can you see a quick solution with
that particular code.
 
Veli Izzet said:
Dirk,

I accomplished everything except for one:

1000 is not ONE THOUSAND but THOUSAND (ONE DROPS). Do you know if the
author is around here so I can ask, or can you see a quick solution
with that particular code.

You could modify it along these lines:

'---- modifications to function English() -----

Dim Quotient As Currency

' ... code for trillions, billions, millions remains unchanged ...

If (N >= Thousand) Then
Quotient = N \ Thousand
If Quotient > 1@ Then
Buf = Buf & EnglishDigitGroup(Quotient) & " "
End If
Buf = Buf & "thousand"
N = N Mod Thousand
If (N >= 1@) Then Buf = Buf & " "
End If


' ... code for rest of function remains unchanged ...

'---- end of modifications to function English() -----

If you use similar logic for hundreds, you'll also need to modify the
code for the function EnglishDigitGroup(). That modification would look
like this:

'---- modifications to function EnglishDigitGroup() -----

' ... beginning of function is unchanged ...

'Do hundreds
Select Case (N \ 100)
Case 0: Buf = "": Flag = False
Case 1: Buf = "hundred": Flag = True

' ... rest of function is unchanged ...

'---- end of modifications to function EnglishDigitGroup() -----

Of course, your functions will supply the Turkish versions of the number
words. And they will probably be called "Turkish()" and
"TurkishDigitGroup()". <g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top