Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


B4PPC and decimal comma


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2007, 08:58 PM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default B4PPC and decimal comma

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.



Scub
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
  #2 (permalink)  
Old 07-02-2007, 09:03 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

The Table control will show numbers (cNumber fields) using the device format.
This is a limitation of the Table control.
Reply With Quote
  #3 (permalink)  
Old 07-02-2007, 09:24 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 636
Default

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
Reply With Quote
  #4 (permalink)  
Old 07-02-2007, 09:39 PM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default

Quote:
Originally Posted by Erel View Post
The Table control will show numbers (cNumber fields) using the device format.
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
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
  #5 (permalink)  
Old 07-02-2007, 09:49 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 636
Default

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
Reply With Quote
  #6 (permalink)  
Old 07-02-2007, 09:59 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,314
Default

Quote:
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.
If , is the thousands shouldnt 51,5 become 51500?
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #7 (permalink)  
Old 07-02-2007, 10:09 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 636
Default

No, because the (useless) commas were only deleted. There's no converter or formatter adding possible trailing zeroes.
Reply With Quote
  #8 (permalink)  
Old 07-02-2007, 10:22 PM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default

Quote:
Sub Globals

End Sub

Sub App_Start
Form1.Show

table1.AddCol(cNumber,"cNumber",50)
table1.AddRow(0)

End Sub

Sub Button1_Click
table1.Cell("cNumber",0) = TextBox1.Text
End Sub
The above code, when entered 5.5 gives in the table 5,5
When entered 5,5 the table gives me 55



Scub
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
  #9 (permalink)  
Old 07-02-2007, 10:35 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 636
Default

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
Reply With Quote
  #10 (permalink)  
Old 07-02-2007, 11:00 PM
Knows the basics
 
Join Date: Jun 2007
Location: Netherlands (Arnhem)
Posts: 71
Default

Quote:
Originally Posted by specci48 View Post
This is a "normal" behaviour!
"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......

Scub.
__________________
PPC: IPAQ 2210, 2GB, CF GPS, CF Wireless
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Binary, Octal, Decimal, Hex converter app agraham Share Your Creations 2 02-20-2008 05:07 PM
B4PPC on USB stick Put Claude Questions & Help Needed 1 01-04-2008 02:33 PM
Stripping decimal places Softselect Questions & Help Needed 11 11-14-2007 01:17 PM
Very slow IDE since B4PPC Ver 5 eclipse_wolfgang Questions & Help Needed 5 10-31-2007 12:49 AM
not b4ppc but the forum Cableguy Forum Discussion 1 04-29-2007 07:10 AM


All times are GMT. The time now is 01:56 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0