Setting decimal symbol

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joza

    Setting decimal symbol

    Hi everybody!

    I have question about setting decimal symbols... In some countries,
    for example in my country we use comma for decimal symbol, but
    in in some other countries it is decimal point. The problem is when
    I use comma and want to save data in database.
    For example if i want to save number 4,50 it saves like 450, but
    if i write 4.50 it regulary saves the number in that format.
    My question is how to make to program knows what to act if my app
    is working on system where decimal symbol is comma or decimal point.
    Or should i use only comma and when saving data i just parse the
    number and replace comma with point?
  • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

    #2
    Re: Setting decimal symbol

    Joza wrote:
    I have question about setting decimal symbols... In some countries,
    for example in my country we use comma for decimal symbol, but
    in in some other countries it is decimal point. The problem is when
    I use comma and want to save data in database.
    For example if i want to save number 4,50 it saves like 450, but
    if i write 4.50 it regulary saves the number in that format.
    My question is how to make to program knows what to act if my app
    is working on system where decimal symbol is comma or decimal point.
    Or should i use only comma and when saving data i just parse the
    number and replace comma with point?
    You can either explicit specify CultureInfo for the
    Parse or if you have really special requirements
    explicit specify a NumberFormatInf o.

    Arne

    Comment

    Working...