对于增值税,SQL Server字段大小声明的正确十进制(p,s)精度和比例是多少?

时间:2021-09-28 15:27:59

I am defining VAT rates (European and other countries levy the VAT tax) in a SQL Server database and am wondering what the ideal decimal definition to capture the necessary precision.

我在SQL Server数据库中定义增值税税率(欧洲和其他国家征收增值税),我想知道什么是理想的十进制定义来捕获必要的精度。

I have seen VAT rates of:

我看过增值税率:

20% (0.20) UK, Italy, Austria, etc.
21% (0.21) Belgium, Ireland, etc. 
19.6% (0.196) Monaco, France

I am curious if there are cases where the VAT rate requires more precision than decimal(4, 3) where p is precision and s is scale. I have read a number of documents and am not sure if the EU or others have a particular specification for the VAT in terms of positions after the "." (or "," in their case). What's to stop the UK from saying their VAT is now 0.20111111 if they want to use some formula-based calculation for the VAT rate instead of a fixed-precision value?

我很好奇是否有增值税率需要比十进制更精确的情况(4,3),其中p是精度,s是比例。我已经阅读了一些文件,并且不确定欧盟或其他国家是否对“。”之后的职位有特定的增值税规范。 (或“,”,在他们的情况下)。如果他们想要使用一些基于公式的增值税率计算而不是固定精度值,那么阻止英国说增值税现在为0.20111111是什么?

Thanks in advance to you international men and women of mystery.

在此先感谢国际神秘男女。

1 个解决方案

#1


2  

According to the PDF document referred at the end of this page, you should be safe with decimal(4,3). Although it seems that some historical cases would have required a precision of 4.

根据本页末尾提到的PDF文档,您应该使用十进制(4,3)安全。虽然看起来某些历史案例需要4的精度。

#1


2  

According to the PDF document referred at the end of this page, you should be safe with decimal(4,3). Although it seems that some historical cases would have required a precision of 4.

根据本页末尾提到的PDF文档,您应该使用十进制(4,3)安全。虽然看起来某些历史案例需要4的精度。