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

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
hkrasser
Posts: 16
Joined: Fri Jul 10, 2009 12:08 pm
Location: Austria

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

Post 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
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mustafa
Posts: 1177
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

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

Post 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
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mustafa
Posts: 1177
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

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

Post 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
User avatar
raumi75
Posts: 135
Joined: Wed Dec 17, 2008 2:31 am
Location: Lünen, Germany
Contact:

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

Post 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
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
raumi75
Posts: 135
Joined: Wed Dec 17, 2008 2:31 am
Location: Lünen, Germany
Contact:

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

Post 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
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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 :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
hkrasser
Posts: 16
Joined: Fri Jul 10, 2009 12:08 pm
Location: Austria

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

Post by hkrasser »

Dear Roberto!
Dear mustafa and raumi!

Thanks for Your answers.
Hans
Post Reply