NetTalk Central

Author Topic: Entry field (String) reads 0,50 as 50  (Read 6452 times)

clarion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Entry field (String) reads 0,50 as 50
« on: March 10, 2008, 03:08:28 PM »
Hi,

In my dict, I have the format of @n6.`2, it shows correctly as 0,50 but when saving I get 50 (have to use .50 as a work around) .

I Downloaded the lasted version of today, and copied one script folder from a example.

cw 6.3 (9057), ABC , Netalk 4.30 (latest)

More info can be supplied if needed :)

Cheers
Tor-Bjarne

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Entry field (String) reads 0,50 as 50
« Reply #1 on: March 16, 2008, 11:09:01 PM »
fixed in the "official" 4.30 release.

Cheers
Bruce

clarion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Entry field (String) reads 0,50 as 50
« Reply #2 on: March 26, 2008, 04:24:18 PM »
Great !! Thank you!

Cheers
Tor-Bjarne

clarion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Entry field (String) reads 0,50 as 5,0
« Reply #3 on: April 08, 2008, 04:52:53 PM »
Hi,

I`ve downloaded the Nettalk Official release, 4.30 and upgraded cw to 6.3 9058
copyed one web filer from examples with subfolders (replacing my own)

Still using @n6.`2 as the format of the field.

But still 0,5 shows up as 5,0, but now 0.5 also shows up as 5,0 ?

Is there somthing I do wrong ?

I do a calculation on the field after save with CalcTid routine.

CalcTid Routine
          If TIM:Tid_Til > TIM:Tid_Fra
            Tmp_Tim$  = TIM:Tid_Til - TIM:Tid_Fra
          Else !S¤L
            Tmp_Tim$ = (24 * 360000) - ((24 * 360000) - TIM:Tid_Til)
            Tmp_Tim$ = ((24 * 360000) - TIM:Tid_Fra ) + Tmp_Tim$
          End


         TIM:Timer = Tmp_Tim$ / 360000
         TIM:Timer = TIM:Timer - TIM:Fratrukket !TIM:Fratrukket now has 5,0 in stead of 0.5
         !------------------------------- Minustid
         TT:Time_Type_Id = TIM:Time_Type_Id
         If Access:Time_Type.TryFetch(TT:Key_ID)
         End
         if TT:MinusTime = True
          TIM:Timer = TIM:Timer * -1
         End

    Display

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Entry field (String) reads 0,50 as 50
« Reply #4 on: April 10, 2008, 12:51:01 AM »
Hi Tor-Bjarne,

hmm. This is what I'd expect. (I haven't tested any of this.)

Consider the "normal" clarion number
1,234.56
this is equal to 1234.56

with your pic this changes to
1.234,56

So for an entry field I'd expect it to accept 1.234,56 or 1,234.56 but not both.
Or am I missing something?

We could make the formatting more fancy, but then how should the following entries be interpreted
1,234
1234,56
1234.56
1.234
1.234,56
1.234.56


Cheers
Bruce

clarion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Entry field (String) reads 0,50 as 50
« Reply #5 on: April 10, 2008, 12:12:01 PM »
Hi,

I Just want to read the , as the decimal point

So a 0,5 (1/2) is interpreted at 0.5 (US)

When I Specify 6.`2 I usually tell cw that , is the desimal (fraction) portion.

But with 4.30 when I have a format(6.`2) on a string field (that shows up correctly) as 0,5 (registered in an win32 app), and Edit this in my web-app using the same format (6.´2), when the field is displayed in the update screen it shows correctly 0,5 .

if I hit [Save], it gets stored as 5

What differences from the previous version is that I could do some sort of workaround, typing the-us-decimal-point 0.5 (But the format was 6.`2), then the data was saved correctly and displayed as 0,5 (as my format still is 6.`2) .

Now however if I enter 0,5 or 0.5 it is still saved as 5,0 (would be 5.0 with a format of 6.2)

In other words, I would like to enter

1,2 = 1.2 (us)
1.500,44 = 1,500.44 (us)
1,5 = 1.5 (us)

and so forth

Cheers
Tor-Bjarne

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Entry field (String) reads 0,50 as 50
« Reply #6 on: April 11, 2008, 12:22:11 AM »
Hi Bjarne,

Some extensive testing later and I'm beginning to appreciate why the DEFORMAT command is more or less useless. I'd already re-coded it (the dFormat method) for the Time fields, and it appears that it could be a lot smarter for numbers as well.

I've re-coded the method to handle this though, and I think you'll be happy now.
(I'll send you the updated CLW in an email)
Sorry for the hassles.

Cheers
Bruce

clarion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Entry field (String) reads 0,50 as 50
« Reply #7 on: April 15, 2008, 02:48:54 PM »
Thank You !!

Now it works

Did I mention I think NetTalk  is a great product  ;D

Cheers
Tor-Bjarne