Index: openacs-4/packages/acs-templating/tcl/currency-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/currency-procs.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/acs-templating/tcl/currency-procs.tcl 26 Jan 2004 15:39:46 -0000 1.8
+++ openacs-4/packages/acs-templating/tcl/currency-procs.tcl 12 Jul 2004 14:49:50 -0000 1.9
@@ -234,7 +234,9 @@
}
}
-ad_proc -public template::widget::currency { element_reference tag_attributes } {
+ad_proc -public template::widget::currency {
+ element_reference tag_attributes {mode edit}
+} {
upvar $element_reference element
@@ -259,13 +261,19 @@
set i 0
foreach format_property $format {
set value [lindex $values 0]
- set values [lrange $values 1 end]
- if { $i == 0 || $i == 2 || $i == 4 } {
- append output "$format_property \n"
- } elseif { $i == 1 || $i == 3 } {
- append output "\n"
- }
- incr i
+ set values [lrange $values 1 end]
+ set trailing_zero ""
+ if { $i == 3 } {
+ set trailing_zero [string range [string repeat "0" $format_property] [string length $value] end]
+ }
+ if { $i == 0 || $i == 2 || $i == 4 } {
+ append output "$format_property"
+ } elseif { [string equal $element(mode) "edit"] && ($i == 1 || $i == 3) } {
+ append output "\n"
+ } else {
+ append output "$value$trailing_zero"
+ }
+ incr i
}
append output "\n"