aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/filter:currency.html21
-rw-r--r--docs/filter:currency.md20
2 files changed, 41 insertions, 0 deletions
diff --git a/docs/filter:currency.html b/docs/filter:currency.html
new file mode 100644
index 00000000..bd277bb8
--- /dev/null
+++ b/docs/filter:currency.html
@@ -0,0 +1,21 @@
+<h1>filter:currency</h1>
+
+<p>formats a number as a currency (ie $1,234.56)</p>
+
+<p>@format <em>expression</em> | currency</p>
+
+<p><example>
+<input type="text" name="amount" value="1234.56"/> <br/>
+{{amount | currency}}
+</example></p>
+
+<p><test>
+ it('should init with 1234.56', function(){
+ expect(bind('amount')).toEqual('$1,234.56');
+ });
+ it('should update', function(){
+ element(':input[name=amount]').value('-1234');
+ expect(bind('amount')).toEqual('-$1,234.00');
+ expect(bind('amount')).toHaveColor('red');
+ });
+</test></p>
diff --git a/docs/filter:currency.md b/docs/filter:currency.md
new file mode 100644
index 00000000..44687a91
--- /dev/null
+++ b/docs/filter:currency.md
@@ -0,0 +1,20 @@
+# filter:currency
+formats a number as a currency (ie $1,234.56)
+
+@format _expression_ | currency
+
+<example>
+<input type="text" name="amount" value="1234.56"/> <br/>
+{{amount | currency}}
+</example>
+
+<test>
+ it('should init with 1234.56', function(){
+ expect(bind('amount')).toEqual('$1,234.56');
+ });
+ it('should update', function(){
+ element(':input[name=amount]').value('-1234');
+ expect(bind('amount')).toEqual('-$1,234.00');
+ expect(bind('amount')).toHaveColor('red');
+ });
+</test> \ No newline at end of file