Change in 'Language settings' results in displaying erroneous values in text boxes


  • Hello,
    I am trying to fix this bug. When I change language settins of my system from English (United states) to Dutch (Belgium), some values are displayed wrong in my software.
    These values are read form access database. I am taking a value as a string and then displaying it using format function.
    txtMax(i).Text = Format(Val(sProp), "#0.0#")
    Each time I refresh my tab, value is changed. I think this is some rounding problem. Has anybody faced this before?
    I understand that Belgian people use period (.) as thousand's separator and comma (,) as decimal point, which is exactly opposite to other locales' convention. And I have code format as '#0.0#'. Does this affect?
    I want my application to run on both language settings. Can anybody help?

    -Apurva Pathak.

    Friday, February 13, 2009 5:24 AM

All replies

  • Hi Apurva,

    I'm going to move this thread over to the .NET Base Class Library forum, they should be able to help you

    Andrew Hall. Visual Studio Debugger. This posting is provided "AS IS"
    Saturday, February 14, 2009 12:46 AM
  • Document your problem.  What is the value of "sProp" and what strings do you see?
    Hans Passant.
    Saturday, February 14, 2009 2:06 AM
  • Hi,
    I am reading value from access database. 'sProp' is a string which contains value read from database. Now I am converting it to a number using Val function. Then a number is displayed in a text box.
    All this looks fine when language setting is English (US), but when I select Dutch (Belgium), wrong values are displayed. When value is set to 40, text box displays 39.99, 38.96, 37.99,...; in the text box, each time screen is refreshed.
    Is it some rounding error? How can I remove this?
    Please help.
    Apurva Pathak.
    Monday, February 16, 2009 11:14 AM