In some calculations, I am expecting to receive a value out to 15 decimal places but I am only getting it out to 6 decimal places.
In the example below, For @ProRata I am getting the value 0.8871340000000 when I expect 0.887134492110339.
DECLARE @EligiblePurchase DECIMAL(38,15) = 0
,@ProRata DECIMAL(38,15) = 0 --Percent of total purchase
,@Reduction DECIMAL(38,15) = 0
,@Denominator DECIMAL(38,15) = 355302907.06 --Total amount across all purchases
,@InitialValue DECIMAL(38,15) = 315201464.00 --Specific purchase
--Sometimes @Reduction will be a reduction % like 16.677777777777777, but in this case it's 0
SET @EligiblePurchase = @InitialValue * ((100.00 - @Reduction) / 100)
SET @ProRata = @EligiblePurchase / @Denominator
SELECT @ProRata
My google-fu is failing me. SqlServer is doing something I am not expecting.
Thanks in advance!!