Skip to content

🎥 Make videos programmatically with React

currency display

Jonny Burger0a4eb9044bd0
diff --git a/packages/lambda/remotionlambda.zip b/packages/lambda/remotionlambda.zip
index b115a429ee..4c16012af2 100644
Binary files a/packages/lambda/remotionlambda.zip and b/packages/lambda/remotionlambda.zip differ
diff --git a/packages/lambda/src/cli/commands/render/progress.ts b/packages/lambda/src/cli/commands/render/progress.ts
index 60be0a5814..383b9f0868 100644
--- a/packages/lambda/src/cli/commands/render/progress.ts
+++ b/packages/lambda/src/cli/commands/render/progress.ts
@@ -88,7 +88,7 @@ export const makeCleanupProgress = (
`${doneIn === null ? 'Cleaning up' : 'Cleaned up'} artifacts`,
doneIn === null
? `${Math.round(progress * 100)}%`
- : CliInternals.chalk.gray('ms'),
+ : CliInternals.chalk.gray(`${doneIn}ms`),
].join(' ');
};
@@ -122,6 +122,7 @@ export const makeMultiProgressFromStatus = (
doneIn: status.encodingStatus?.doneIn ?? null,
},
lambdaInvokeProgress: {
+ // TODO: Calculate invoke progress
doneIn: null,
lambdasInvoked: status.lambdasInvoked,
totalLambdas:
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index 1e0cf6f182..7b4c029793 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -146,12 +146,18 @@ export const renderCommand = async (args: string[]) => {
.join('\n')
);
Log.info();
+ Log.info();
Log.info('Done!', outputPath, formatBytes(size));
} else {
+ Log.info();
Log.info();
Log.info('Done! ' + newStatus.outputFile);
}
+ Log.info(
+ `${newStatus.renderMetadata?.estimatedTotalLambdaInvokations} λ's used, Estimated cost $${newStatus.costs.displayCost}`
+ );
+
process.exit(0);
}
diff --git a/packages/lambda/src/functions/helpers/format-costs-info.ts b/packages/lambda/src/functions/helpers/format-costs-info.ts
index e59af98310..398f49fe5d 100644
--- a/packages/lambda/src/functions/helpers/format-costs-info.ts
+++ b/packages/lambda/src/functions/helpers/format-costs-info.ts
@@ -1,12 +1,22 @@
import {CostsInfo} from '../../shared/constants';
+const display = (accrued: number) => {
+ if (accrued < 0.001) {
+ return '<$0.001';
+ }
+
+ return new Intl.NumberFormat('en-US', {
+ currency: 'USD',
+ style: 'currency',
+ currencyDisplay: 'narrowSymbol',
+ minimumFractionDigits: 3,
+ }).format(accrued);
+};
+
export const formatCostsInfo = (accrued: number): CostsInfo => {
return {
accruedSoFar: accrued,
- displayCost: new Intl.NumberFormat('en-US', {
- currency: 'USD',
- currencyDisplay: 'narrowSymbol',
- }).format(accrued),
+ displayCost: display(accrued),
currency: 'USD',
disclaimer:
'Estimated cost only. Does not include charges for other AWS services.',