Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. money datatype

money datatype

Scheduled Pinned Locked Moved Database
csharpdatabasequestionasp-netsql-server
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jetset32
    wrote on last edited by
    #1

    hi all, Jsut a quick question, I have a product database with a productcost field, when i enter a cost into the field i use for exemple £100 or £0.50. When I run my website in asp.net it shows a dollar sign $ instead of a pound sign. Any ideas on how to correct this? I have checked the help files in SQL server 2000 and also in visual studio.net...cant find anything related....its gotta be something easy?? Thanks in advance!

    L 1 Reply Last reply
    0
    • J jetset32

      hi all, Jsut a quick question, I have a product database with a productcost field, when i enter a cost into the field i use for exemple £100 or £0.50. When I run my website in asp.net it shows a dollar sign $ instead of a pound sign. Any ideas on how to correct this? I have checked the help files in SQL server 2000 and also in visual studio.net...cant find anything related....its gotta be something easy?? Thanks in advance!

      L Offline
      L Offline
      Luis Alonso Ramos
      wrote on last edited by
      #2

      Is your website hosted in the same machne where you edit the database? If not, your machine probably is configured (in Control Panel, Regional settings) to format the currency values like British (pounds). And probably the ASP.NET server is configured for an english-US culture. Do something like this in your ASP.NET code:

      CultureInfo ci = new CultureInfo("en-br");  // Check the "en-br" so it's for Britain, maybe "en-UK"
      decimal dMyMoney = 12.99m;
      string strMoneyInPounds = dMyMoney.ToString("c", ci);
      

      I'm not exactly sure of the syntax, but that should format your decimal value as currency (the "c" parameter) using the English (UK variant) culture. -- LuisR


      Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

      J 1 Reply Last reply
      0
      • L Luis Alonso Ramos

        Is your website hosted in the same machne where you edit the database? If not, your machine probably is configured (in Control Panel, Regional settings) to format the currency values like British (pounds). And probably the ASP.NET server is configured for an english-US culture. Do something like this in your ASP.NET code:

        CultureInfo ci = new CultureInfo("en-br");  // Check the "en-br" so it's for Britain, maybe "en-UK"
        decimal dMyMoney = 12.99m;
        string strMoneyInPounds = dMyMoney.ToString("c", ci);
        

        I'm not exactly sure of the syntax, but that should format your decimal value as currency (the "c" parameter) using the English (UK variant) culture. -- LuisR


        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

        J Offline
        J Offline
        jetset32
        wrote on last edited by
        #3

        Thanks for your help....I've sorted it out now..Knew it would be something simple! Cheers Jetset

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups