Page 1 of 1

Grid with numbers in german format (, instead of . )

Posted: Mon Mar 08, 2010 8:14 pm
by hkrasser
Dear posters!
I read a lot from Sudip (especially "Auto Calculation with Grid") - it's wonderful.
My problem: In Austria /Germany numbers use the colon instead of the point,
for example 123,10 (means $ 123.10)
Where can I change the number-format in Grid?

HB_LANGSELECT( "DE" )
COLUMNCONTROLS { {'TEXTBOX','NUMERIC'} }
did not work

Re: Grid with numbers in german format (, instead of . )

Posted: Mon Mar 08, 2010 8:32 pm
by Roberto Lopez
hkrasser wrote:Dear posters!
I read a lot from Sudip (especially "Auto Calculation with Grid") - it's wonderful.
My problem: In Austria /Germany numbers use the colon instead of the point,
for example 123,10 (means $ 123.10)
Where can I change the number-format in Grid?

HB_LANGSELECT( "DE" )
COLUMNCONTROLS { {'TEXTBOX','NUMERIC'} }
did not work
You must include 'cFormat' optional parameter and specify as 'E'.
Control Definition Array:

TEXTBOX

{ cControlType , cDataType , cInputMask , cFormat }

cControlType = 'TEXTBOX' (Required)

cDataType = 'CHARACTER' , 'NUMERIC' , 'DATE' (Required)

cInputMask = cInputMask (Optional)

cFormat = cFormat (Optional)
InputMask String For numeric textBox

9 Displays digits
$ Displays a dollar sign in place of a leading space
* Displays an asterisk in place of a leading space
. Specifies a decimal point position
, Specifies a comma position

Format String

C Displays CR after positive numbers
X Displays DB after negative numbers
( Encloses negative numbers in parentheses
E Displays points as thousand separator and comma as decimal
separator.

Re: Grid with numbers in german format (, instead of . )

Posted: Tue Mar 09, 2010 10:15 am
by mustafa
Hola maestro Roberto
Este formato especial 'E' como se podria aplicar
en los campos númericos monetarios en los el Browse
y el Grid para que se vea en formato Europeo ?
ejemplo: 1.250,25 €
Gracias
*...........................................*
Hello Master Roberto
This special format 'E' as it might apply
in monetary numeric fields in the Browse and the Grid
so you can see in the European format?
Example: 1.250,25 €
Thanks
Mustafa

Re: Grid with numbers in german format (, instead of . )

Posted: Tue Mar 09, 2010 11:49 am
by Roberto Lopez
mustafa wrote:Hola maestro Roberto
Este formato especial 'E' como se podria aplicar
en los campos númericos monetarios en los el Browse
y el Grid para que se vea en formato Europeo ?
ejemplo: 1.250,25 €
Gracias
*...........................................*
Hello Master Roberto
This special format 'E' as it might apply
in monetary numeric fields in the Browse and the Grid
so you can see in the European format?
Example: 1.250,25 €
Thanks
Mustafa
mmm... I'm afraid that my answer was not fully right :)

I've forgot that the question was about grid.

In such case, the solution will be use 'DynamicDisplay' property with 'Transform' function to handle the format of numbers.

Re: Grid with numbers in german format (, instead of . )

Posted: Tue Mar 09, 2010 1:59 pm
by mustafa
Sorry Robert for your trouble
The problem of monetary presentation was raised in €
other post, and the comma in decimal operations €
In TextBox FORMAT 'E' solved but these data
when visualized in a Browser or in a Grid are example
521.45 and I said that it saw 521,45
greetings
*---------------------------------------*
Perdon Roberto por la molestia
El problema de la presentación monetaria € ya se planteo en
otros post , y la coma en los decimales en operaciones con €
En TEXTBOX con FORMAT 'E' solucionado pero estos datos
cuando los visualizo en un Browse o en un Grid se ven ejemplo
521.45 y yo decia que se vieran 521,45
un saludo
Mustafa

Re: Grid with numbers in german format (, instead of . )

Posted: Tue Mar 09, 2010 2:00 pm
by raumi75
Well in my experience, it is not a good idea to use the E Format on Input-TextBox. HMG is a remarkable piece of software, but the Numeric InputBox could be better.

It does exactly, what it says in the documentation. And nothing more.

"E Displays points as thousand separator and comma as decimal separator."

It only displays it that way. When trying to enter Data, you still have to use . for the decimal-point. This really confuses new users. I know, this has been a topic in this forum, before, but allow me to make my point.

I am not really into usability-testing, but I like to look people over the shoulder, when they use my software. Here is what happens, when you use the E-Option with a PICTURE of "99.9"

The user wants to enter something like 1,5. So she types 1,5 on her numeric-key-pad, which results in a "15. " in the textbox. She realizes, that something was wrong and tries to correct the mistake by pressing backspace, which does not work, because the cursor is now right of the decimal-point, which you can't delete. This really stumps her. She might find out that she has to use a cursor-key or the mouse, to go left, but that takes a while, as she expects a completely different behavior from her experience with other software.

I am a big fan of joelonsoftware.com

If you don't know it, it recommend reading the article Figuring Out What They Expected

And the rather long - but worth it: Controlling your Environment Makes You Happy

Roberto, is the numeric textbox-control a standard-windows component, or is it possible to change the behaviour of the box?

IMHO when a user types "," or "." in E-Mode, a decimal-point should be accepted.
When the user is right of the decimal point, a backspace should move the cursor to the left, so that the next backspace deletes the number to the left of the decimal-point.

Raumi

Re: Grid with numbers in german format (, instead of . )

Posted: Tue Mar 09, 2010 4:57 pm
by Roberto Lopez
raumi75 wrote:HMG is a remarkable piece of software, but the Numeric InputBox could be better.
I agree.

This is the following thing on my list of things can could be better after the browse control (already replaced by Grid).
raumi75 wrote: Roberto, is the numeric textbox-control a standard-windows component, or is it possible to change the behaviour of the box?
AFAIK, there is not native support on Windows API for edit masks.

Yes. It is possible to change the inputmask behavior.

Re: Grid with numbers in german format (, instead of . )

Posted: Tue Mar 09, 2010 7:15 pm
by raumi75
If you achieve such a big leap as with the transition from browse to grid-control, I am really looking forward to it.

Raumi

Re: Grid with numbers in german format (, instead of . )

Posted: Tue Mar 09, 2010 10:02 pm
by Roberto Lopez
raumi75 wrote:If you achieve such a big leap as with the transition from browse to grid-control, I am really looking forward to it.

Raumi
I've not finished with Grid yet :)

Re: Grid with numbers in german format (, instead of . )

Posted: Wed Mar 10, 2010 5:36 pm
by hkrasser
Dear Roberto!
Dear mustafa and raumi!

Thanks for Your answers.
Hans