0

Label should support format

asked 2014-01-20 13:29:56 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

I found the feature has been added here

But when i try to use, it says property not found

<listfooter>
                        <label format="#,###.##"
                            value="@load(vm.searchTotals.totalInsPayments)" />
                    </listfooter>
delete flag offensive retag edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2014-01-23 02:51:31 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

updated 2014-01-23 04:36:55 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Sorry i didn't see the link properly. But we need to change format as

<label value="@load(c:formatNumber(vm.number, '$#,###.00'))" />

otherwise number without decimal it not showing two zero after decimal

link publish delete flag offensive edit

Comments

I don't see a problem, just do it... java supports different format strings ;) http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html

cor3000 ( 2014-02-13 07:17:03 +0800 )edit
0

answered 2014-01-21 03:51:12 +0800

cor3000 gravatar image cor3000
6280 2 7

I just followed the example from my link above and created this zk fiddle

Is there anything unclear about the documentation?

link publish delete flag offensive edit
0

answered 2014-01-21 02:35:17 +0800

cor3000 gravatar image cor3000
6280 2 7

@Chill: right, there is no additional "format" attribute on a label.

You can format a label using the c:formatNumber EL core-method directly inside the EL.

You can also call these methods from mvvm @load bindings.

Robert

link publish delete flag offensive edit

Comments

can you post a small example using MVVM please

Senthilchettyin ( 2014-01-21 03:21:04 +0800 )edit
0

answered 2014-01-20 14:24:19 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2014-01-20 14:24:28 +0800

http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Label.html

Sorry to say that there is no format there.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-01-20 13:29:56 +0800

Seen: 59 times

Last updated: Jan 23 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More