Quiq::ColumnFormat - Format einer Text-Kolumne
Quiq::Object
Ein Objekt der Klasse ist Träger von Formatinformation über einer Menge von Werten, die tabellarisch dargestellt werden sollen, z.B. in einer Text- oder HTML-Tabelle.
Die Methoden der Klasse formatieren die Werte der Wertemenge entsprechend und liefern Information über die Ausrichtung.
$fmt = $class->new($type,$width,$scale,$null,$mask);
Die übergebenen Parameter enthalten folgende Information:
Typ ('t', 's', 'd' oder 'f').
Länge des längsten Werts.
Maximale Anzahl an Nachkommastellen (im Falle von Werten vom Typ f).
Anzahl der Nullwerte.
Maximale Anzahl der zu maskierenden Zeichen bei einzeiliger Darstellung. Maskiert werden die Zeichen \n, \r, \t, \0, \\.
$width = $fmt->width;
$str = $fmt->asFixedWidthString($value);
$html = $fmt->asTdContent($value);
$align = $fmt->htmlAlign;
Für numerische Kolumnen wird der Wert 'right' geliefert, für Textkolumnen der Wert 'left';
1.138
Frank Seitz, http://fseitz.de/
Copyright (C) 2019 Frank Seitz
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Quiq, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Quiq
CPAN shell
perl -MCPAN -e shell install Quiq
For more information on module installation, please visit the detailed CPAN module installation guide.