Store Float in MySQL | ATLASSC.NET
Skip to main content
/// .DATA.FRAGMENT_20230117

Store Float in MySQL

1 minAuthor: Z.SHINCHVEN

Storing a float number in MySQL, you must specify the column's precision and scale.

CREATE TABLE `test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `value` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  • 10: is the precision, which is the total number of digits.
  • 2: is the scale, which is the number of digits after the decimal point.

Reference

RackNerd Billboard Banner
Share node:
/// .RELATED.DATA_STREAMSShared tags

Related posts

Scanning_database_for_correlations…

/// .UPLINK.SUBSCRIBE

Keep your deck synced with every new transmission from ATLASSC.NET. Subscribe over RSS or Atom, or wire the whole archive straight into your AI assistant with the MCP server.