diff --git a/src/Sav/Writer.php b/src/Sav/Writer.php index fc74667..6668698 100644 --- a/src/Sav/Writer.php +++ b/src/Sav/Writer.php @@ -201,7 +201,11 @@ public function write($data) $this->data->matrix[$case][$idx] = $value; } - $nominalIdx += Utils::widthToOcts($var->width); + if (Variable::isNumberFormat($var->format)) { + $nominalIdx += 1; + } else { + $nominalIdx += Utils::widthToOcts($var->width); + } } $this->header->nominalCaseSize = $nominalIdx;