Avatar billede guzzie Nybegynder
03. september 2001 - 08:49 Der er 7 kommentarer og
1 løsning

amount in kroner

Hi There :)
I am trying to create a little shopping system and it seems to be going ok except that I am tring to get my amount shown to be shown in kroner
for example
If I have the following number
55150,50
I would like it to be shown like this
55.150,50

I have a funchion that i use that can insert a comma like this
55150,50 but of course this is not optimal
Does any body Have and ideas ?
Thanks
Guzzie
Avatar billede nordclc Nybegynder
03. september 2001 - 09:00 #1
Prøv at indsætte følgende i toppen af din asp side:

Session.LCID = 1030

//Claus
Avatar billede eagleeye Praktikant
04. september 2001 - 09:41 #2
You can use FormatNumebr or FormatCurrency:

Kr.<%= FormatNumber(55150.50\",2) %>

or

<%= FormatCurrency(55150.50,2) %>

The format will be the same as the one set in Regional Settings Currency on the server.
Avatar billede guzzie Nybegynder
04. september 2001 - 10:20 #3
hey guys
nordclc/ I cant seem to get it to work :(

hi eagleeye 
this works fine
<%= FormatCurrency(55150.50,2) %>
however my amount uses commas and not dots this this
<%= FormatCurrency(55150,50,2) %>
then i get an error
I have a function to replace commas like this
    FUNCTION fixComma( theString)
        fixComma = Replace( theString, \",\", \".\" )
    END FUNCTION

but I dont know if this uses to many resouces ?
or if its ok to use
for example:
change the amounts commas to dot
then use FormatCurrency ?
Guzzie
Avatar billede eagleeye Praktikant
04. september 2001 - 10:36 #4
Do you get the amount, from a database?
If so what format is the cell, Currency or number?
Avatar billede guzzie Nybegynder
04. september 2001 - 10:43 #5
eagleeye/ its a number :)
Guzzie
Avatar billede guzzie Nybegynder
04. september 2001 - 10:43 #6
oops :) yes its from a db
Avatar billede eagleeye Praktikant
04. september 2001 - 10:59 #7
Ok if you get the number whit \",\" and not \".\" I thinks you need to convert , to . as you described.

But I was expecting the number/database to seprate with \".\".
Avatar billede guzzie Nybegynder
04. september 2001 - 12:27 #8
ok I will do it like that convert first then use
FormatCurrency after :)
thanks
Guzzie
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester