Hi,
Your PS script is perfect. But you made one mistake. You have calculated the UseageQunatity instead of the Pretax Cost.
here is the script which will give you the exact cost :
$costTotal=0
$RGName ="RGNAME"
$StartDay="2019-12-01"
$EndDay="2019-12-06"
$VMName="vm1"
$Consumption = Get-AzConsumptionUsageDetail -ResourceGroup $RGName -StartDate
$StartDay -EndDate $EndDay -InstanceName $VMName
$Costs = $Consumption.PretaxCost
foreach ($Cost in $Costs) { $CostTotal += $Cost}
$CostTotal