Currency Format
Currency Format
How do I display a signed(15,4) field in a currency format i.e $1,505.25?
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Currency Format
The next EPC will have support Edit Word support.
This allows formatting to be applied to field when it is not in focus.
An edit word similar to
will format the number. You may need to move it to a field with the appropriate number of decimal places.
Regards
This allows formatting to be applied to field when it is not in focus.
An edit word similar to
Code: Select all
' , , , $0. 'Regards
Re: Currency Format
Good to know.
Until then I got it work by defining the fields with the right number of decimals
Then when the data is returned from the ServerModule
Until then I got it work by defining the fields with the right number of decimals
Code: Select all
define field(#HoursWorked) type(*SIGNED) length(15) decimals(2)
define field(#GrossBillings) type(*SIGNED) length(15) decimals(2)
define field(#GrossMargin) type(*SIGNED) length(15) decimals(2)
Code: Select all
#HoursWorked := #WSHRW.Round( HalfDown 2 )
#GrossBillings := #WSBG.Round( HalfDown 2 )
#GrossMargin := #WSGMA.Round( HalfDown 2 )
#HoursWorkedLabel.Caption := #HoursWorked.AsDisplayString( EditCode_N )
#GrossBillingsLabel.Caption := "$" + #GrossBillings.AsDisplayString( EditCode_N )
#GrossMarginLabel.Caption := "$" + #GrossMargin.AsDisplayString( EditCode_N )
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Currency Format
Not that I care about a few keystrokes here or there, but there's no need to specify .Caption when populating a label.
The Caption property is the default property, so this will produce the same result.
Similarly, spin edit and edit have a default property of Value.
Regards
The Caption property is the default property, so this will produce the same result.
Code: Select all
#HoursWorkedLabel := #HoursWorked.AsDisplayString( EditCode_N )Regards
- moon.gallop
- Posts: 1
- Joined: Fri Dec 09, 2016 11:37 pm