B4PPC and decimal comma

Discussion in 'Questions (Windows Mobile)' started by Scubaticus, Jul 2, 2007.

  1. Scubaticus

    Scubaticus Active Member Licensed User

    Here in the Netherlands we don't use the point but comma as our digit sign.
    Normally this is controlled by local setting in windows (I use an english version with local setting to dutch). In, for example excel, this is working normally. In B4PPC however it seems it only will eat the point as decimal point.

    So moving a textbox1.text with 51.5 to a cNumber cell, the value will be 51.5
    When using 51,5 the cell has the value 515

    When the first 51.5 however is shown in the table, when I display it in a form it fomrats as 51,5.

    This both on my PC and PPC.

    I fixed this by change the comma into a point when the field value changes, but that seems a very strange way to me.

    :sign0085:

    Scub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Table control will show numbers (cNumber fields) using the device format.
    This is a limitation of the Table control.
     
  3. specci48

    specci48 Well-Known Member Licensed User

    Is it possible to use the device format generally so that I can do something like this:

    Code:
    a = 16,5
    b = 
    3
    c = a / b

    specci48
     
  4. Scubaticus

    Scubaticus Active Member Licensed User

    Well, this is no limitation for me as it behaves the way it should. I want a decimal comma and see a decimal comma. But how obout the input of 51.5 versus 51,5? It seems on the input there's a limitation?

    Scub
     
  5. specci48

    specci48 Well-Known Member Licensed User

    With the input of 51.5 the point is handled as a decimal point so the variable value is 51.5.
    With the input of 51,5 the comma is handled like a thousand separator (as in 123,456.78) which is of no use when the data is stored in a numeric variable. So the variable value is 515.


    specci48
     
  6. Cableguy

    Cableguy Expert Licensed User

    If , is the thousands shouldnt 51,5 become 51500?
     
  7. specci48

    specci48 Well-Known Member Licensed User

    No, because the (useless) commas were only deleted. There's no converter or formatter adding possible trailing zeroes.
     
  8. Scubaticus

    Scubaticus Active Member Licensed User

    The above code, when entered 5.5 gives in the table 5,5
    When entered 5,5 the table gives me 55

    :SHOCKED:

    Scub
     
  9. specci48

    specci48 Well-Known Member Licensed User

    This is a "normal" behaviour!

    If you enter 5.5 we have a decimal point. So the value of the tablecell with format cNumber is 5.5. As Erel said, for showing the tablecontrol the control converts the values to the default device format. This is done only for the output. The internal variables still remain in the number format with decimal point.
    If you enter 5,5 the value of the tablecell gets 55 (only the comma is removed). Showing this value in the tablecontrol (there is no format conversion necessary) will result in 55.

    specci48
     
  10. Scubaticus

    Scubaticus Active Member Licensed User

    "It's life Jim, but not as we know it, it's life"

    I just have to get used to B4PPC, but it's going fast, thanks to all your quick replies! Well, still some problems to solve......:sign0151:

    Scub.
     
  11. RandomCoder

    RandomCoder Well-Known Member Licensed User

    If you are worried that the comma might be used in the TextBox instead of a decimal place then you could try to catch and replace it before entering the number into the Table :)

    Regards,
    RandomCoder
     
  12. Scubaticus

    Scubaticus Active Member Licensed User

    Well that's not enough. We also use the point as a thousand separator. I'll probable end up with a conversion sub.

    Scub
     
  13. specci48

    specci48 Well-Known Member Licensed User

    This's what I have done in my applictions, too. ;)

    specci48
     
Loading...