fix: calculation method having wrong format

This commit is contained in:
Daniel Bulant 2022-05-17 22:06:15 +02:00
parent fece2ba8ad
commit ec62427d52

View file

@ -14,30 +14,35 @@
name: "Cloudflare R2", name: "Cloudflare R2",
nameShort: "R2", nameShort: "R2",
price: ({ storage, egress, fileCount, dataRetention }) => 10 * storage + Math.max(0, fileCount-10e6)*0.36/1e6, price: ({ storage, egress, fileCount, dataRetention }) => 10 * storage + Math.max(0, fileCount-10e6)*0.36/1e6,
priceString: "10 * storage + Math.max(0, fileCount-10e6)*0.36/1e6",
color: "orange", color: "orange",
link: "cloudflare-r2" link: "cloudflare-r2"
}, { }, {
name: "Wasabi", name: "Wasabi",
nameShort: "Wasabi", nameShort: "Wasabi",
price: ({ storage, egress, fileCount, dataRetention }) => 5 * storage * (90/dataRetention), price: ({ storage, egress, fileCount, dataRetention }) => 5 * storage * (90/dataRetention),
priceString: "5 * storage * (90/dataRetention)",
color: "green", color: "green",
link: "wasabi" link: "wasabi"
}, { }, {
name: "Backblaze B2", name: "Backblaze B2",
nameShort: "B2", nameShort: "B2",
price: ({ storage, egress, fileCount, dataRetention }) => 4 * storage + 10 * egress + Math.max(0, fileCount - 2500)*4/10e6, price: ({ storage, egress, fileCount, dataRetention }) => 4 * storage + 10 * egress + Math.max(0, fileCount - 2500)*4/10e6,
priceString: "4 * storage + 10 * egress + Math.max(0, fileCount - 2500)*4/10e6",
color: "red", color: "red",
link: "backblaze-b2" link: "backblaze-b2"
}, { }, {
name: "DO Spaces", name: "DO Spaces",
nameShort: "Spaces", nameShort: "Spaces",
price: ({ storage, egress, fileCount, dataRetention }) => 20 * storage + 10 * egress, price: ({ storage, egress, fileCount, dataRetention }) => 20 * storage + 10 * egress,
priceString: "20 * storage + 10 * egress",
color: "blue", color: "blue",
link: "digitalocean-spaces" link: "digitalocean-spaces"
}, { }, {
name: "Storj.io", name: "Storj.io",
nameShort: "Storj", nameShort: "Storj",
price: ({ storage, egress, fileCount, dataRetention }) => 4 * storage + 7 * egress, price: ({ storage, egress, fileCount, dataRetention }) => 4 * storage + 7 * egress,
priceString: "4 * storage + 7 * egress",
color: "rgb(0,120,180)", color: "rgb(0,120,180)",
link: "storjio" link: "storjio"
} }
@ -148,7 +153,7 @@
{#each data as service} {#each data as service}
<tr> <tr>
<td><a href="#{service.link}">{service.name}</a></td> <td><a href="#{service.link}">{service.name}</a></td>
<td><code>{service.price.toString().substring(service.price.toString().indexOf("=>") + 3)}</code></td> <td><code>{service.priceString}</code></td>
<td>${Math.floor(service.price({ egress, fileCount, storage, dataRetention }))}/TB/month</td> <td>${Math.floor(service.price({ egress, fileCount, storage, dataRetention }))}/TB/month</td>
</tr> </tr>
{/each} {/each}