issue: using computed observable to format field

36 views
Skip to first unread message

Greg Greenhaw

unread,
May 25, 2017, 3:52:22 PM5/25/17
to KnockoutJS
I am using a computed observable to format the value in a text field, So the numeric value is formated like "$5.00" and if
someone types a value of 5 in the field when the value is already $5.00 the field looses it formating. 
So instead of the input value looking like $5.00 it looks like 5. 
So amount the amount didn't technically update the input lost its formating.

Eric Anderson

unread,
May 26, 2017, 1:57:00 PM5/26/17
to KnockoutJS
http://knockoutjs.com/documentation/computed-writable.html

Take a look at the above. Without your code to reference, it sounds like you are overwriting your computed when the user enters a new value.
Reply all
Reply to author
Forward
0 new messages