Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created January 6, 2020 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BetterProgramming/fbdc279bb911b1023edb9e8b04be7166 to your computer and use it in GitHub Desktop.
Save BetterProgramming/fbdc279bb911b1023edb9e8b04be7166 to your computer and use it in GitHub Desktop.
// ./src/Totals.js
import Total from "./Total";
import round from "./round";
...
return (
<div>
<Total title={"Ending Value (USD)"} value={`$${round(endTotal, 2)}`} />
<Total title={"Amount of Coin (BTC)"} value={round(totalCoinAmount, 5)} />
<Total
title={"Amount Invested (USD)"}
value={`$${round(totalInvested, 2)}`}
/>
<Total title={"Gained (USD)"} value={`$${round(numberGained, 2)}`} />
<Total title={"Gained (%)"} value={`${round(percentGained, 2)}%`} />
</div>
);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment