我在数据库中指定了以下列:decimal(5,2)
怎么解释这个?
根据SQL Server Management Studio中查看的列上的属性,我可以看到它表示:十进制(数字精度,数字刻度).
精确度和规模在实际意义上是什么意思?
很容易将其解释为带有5位数和2位小数位的十进制数...即12345.12
PS我已经能够从同事那里确定正确的答案,但很难在网上找到答案.因此,我想在stackoverflow上记录问题和答案,以备将来参考.
我想在laravel模式中创建一个价格列.
public function up()
{
Schema::create('cameras', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('condition');
$table->string('price');
$table->string('type');
$table->timestamps();
});
}
Run Code Online (Sandbox Code Playgroud)
或者我可以使用替代数据类型吗?因为我在文档中没有看到任何货币价值.任何帮助,将不胜感激.