Skip to content

Commit

Permalink
Leading zeroes should be stored as a string to preserve them in the DB
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Sep 21, 2023
1 parent 0592675 commit d272229
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/fields/number.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ public function schema( $options = null ) {

$schema = 'DECIMAL(' . $length . ',' . $decimals . ')';

if ( 1 === (int) pods_v( static::$type . '_keep_leading_zeroes', $options, 255 ) ) {
$schema = 'VARCHAR(' . $length . ')';
}

return $schema;

}
Expand Down

0 comments on commit d272229

Please sign in to comment.