--- megatec.c.orig	2008-10-09 22:15:51.000000000 +0100
+++ megatec.c	2008-10-09 21:32:06.000000000 +0100
@@ -151,6 +151,9 @@
 static float battvolt_empty = -1;  /* unknown */
 static float battvolt_full = -1;   /* unknown */
 
+/* Battery voltage multiplier (to match the nominal voltage on some models) */
+static float battvolt_mult = 1;
+
 /* Minimum and maximum voltage seen on input */
 static float ivolt_min = INT_MAX;  /* unknown */
 static float ivolt_max = -1;       /* unknown */
@@ -454,7 +457,8 @@
 	values->freq = atof(field);
 
 	anchor = copy_field(field, anchor + 1, 4);
-	values->battvolt = atof(field);
+	values->battvolt = atof(field) * battvolt_mult;
+	upsdebugx(3, "Q1 => battery voltage multiplied by %.1f.", battvolt_mult);
 
 	anchor = copy_field(field, anchor + 1, 4);
 	values->temp = atof(field);
@@ -559,6 +563,19 @@
 		}
 	}
 
+	/*
+	 * The battery voltage multiplier should *always* be applied to the current
+	 * battery voltage value, so it must be set before this value is ever used.
+	 */
+	if (getval("battvoltmult")) {
+		upsdebugx(2, "Parameter [battvoltmult]: [%s]", getval("battvoltmult"));
+
+		/* Having SHRT_MAX as the upper-bound is an arbitrary choice... */
+		battvolt_mult = CLAMP(atof(getval("battvoltmult")), 1, SHRT_MAX);
+
+		upslogx(LOG_NOTICE, "The battery voltage reported by the UPS will be multiplied by %.1f.", battvolt_mult);
+	}
+
 	if (getval("battvolts")) {
 		upsdebugx(2, "Parameter [battvolts]: [%s]", getval("battvolts"));
 
@@ -921,16 +938,17 @@
 
 void upsdrv_makevartable(void)
 {
-	addvar(VAR_VALUE, "mfr"      , "Manufacturer name");
-	addvar(VAR_VALUE, "model"    , "Model name");
-	addvar(VAR_VALUE, "serial"   , "UPS serial number");
-	addvar(VAR_VALUE, "lowbatt"  , "Low battery level (%)");
-	addvar(VAR_VALUE, "ondelay"  , "Minimum delay before UPS startup (minutes)");
-	addvar(VAR_VALUE, "offdelay" , "Delay before UPS shutdown (minutes)");
+	addvar(VAR_VALUE, "mfr", "Manufacturer name");
+	addvar(VAR_VALUE, "model", "Model name");
+	addvar(VAR_VALUE, "serial", "UPS serial number");
+	addvar(VAR_VALUE, "lowbatt", "Low battery level (%)");
+	addvar(VAR_VALUE, "ondelay", "Minimum delay before UPS startup (minutes)");
+	addvar(VAR_VALUE, "offdelay", "Delay before UPS shutdown (minutes)");
 	addvar(VAR_VALUE, "battvolts", "Battery voltages (empty:full)");
+	addvar(VAR_VALUE, "battvoltmult", "Battery voltage multiplier");
 	addvar(VAR_FLAG , "ignoreoff", "Ignore the OFF status reported by the UPS.");
-	addvar(VAR_VALUE, "dtr"      , "Serial DTR line state (0/1)");
-	addvar(VAR_VALUE, "rts"      , "Serial RTS line state (0/1)");
+	addvar(VAR_VALUE, "dtr", "Serial DTR line state (0/1)");
+	addvar(VAR_VALUE, "rts", "Serial RTS line state (0/1)");
 
 	megatec_subdrv_makevartable();
 }
