[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 20 Sep 2002 21:11:18 -0000


albertel		Fri Sep 20 17:11:18 2002 EDT

  Modified files:              
    /loncom/homework	default_homework.lcpm 
  Log:
  - fixes reopend BUG#485
  
  
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.49 loncom/homework/default_homework.lcpm:1.50
--- loncom/homework/default_homework.lcpm:1.49	Fri Sep 20 14:19:25 2002
+++ loncom/homework/default_homework.lcpm	Fri Sep 20 17:11:18 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
 #
-# $Id: default_homework.lcpm,v 1.49 2002/09/20 18:19:25 albertel Exp $
+# $Id: default_homework.lcpm,v 1.50 2002/09/20 21:11:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -445,6 +445,7 @@
   my $dollarmode;
   if ($fmt =~ /^\$(.*)/) { $fmt=$1; $dollarmode=1; } 
   my $result=sprintf('%.'.$fmt,$value);
+  $result=~s/(E[+-]*)0/$1/;
   if ($dollarmode) {$result=&dollarmode($result);}
   return $result;
 }
@@ -460,6 +461,7 @@
     if ($dollarmode) { $frac=&dollarformat($frac); }
     my $exponent=$2;
     $exponent=~s/^\+0*//;
+    $exponent=~s/^-0*/-/;
     if ($exponent) {
       if ($external::target eq 'web') {
 	$result=$frac.'&#215;10<sup>'.$exponent.'</sup>';