Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
changes
  • Loading branch information
Tisha6661 committed Jun 3, 2024
1 parent a529cf5 commit 688d905
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/Blocks/CompoundInterest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import styles from "./BlockStyles.module.css";

function calCompoundInterest(Principal_amount, Annual_rate, Years, Times_compounded){
let ci;
ci = Principal_amount * (1 + Annual_rate / Times_compounded) ** (Times_compounded * Years);
ci = Principal_amount * (1 + (Annual_rate/100) / Times_compounded) ** (Times_compounded * Years);
return ci.toFixed(2);
}

Expand Down
4 changes: 2 additions & 2 deletions components/Blocks/EffectiveAnnualRate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import styles from "./BlockStyles.module.css";

function calsimpleinterest(Annual_rate, Times_compounded){
let ear;
ear = (1 + Annual_rate / Times_compounded)**Times_compounded - 1;
ear = (1 + (Annual_rate/100) / Times_compounded)**Times_compounded - 1;
return ear.toFixed(2);
}

Expand All @@ -19,7 +19,7 @@ function EAR({userData}) {
<div
className={` w-[360px] m-3 p-4 rounded-lg font-extrabold bg-slate-700 ${styles.blockHeightAdjustable} `}
>
Effective Annual Rate : <span className='px-2'>Rs {ear} </span>
Effective Annual Rate : <span className='px-2'> {ear} % </span>
<br/>
<div className='text-xs italic w-full pt-1 truncate'>The Effective Annual Rate (EAR) reflects the actual annual return on an investment or the actual annual interest rate on a loan, accounting for compounding within the year.</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/Blocks/SimpleInterest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styles from "./BlockStyles.module.css";

function calsimpleinterest(Principal_amount, Annual_rate, Years){
let si;
si = Principal_amount * (1 + Annual_rate * Years);
si = Principal_amount * (1 + (Annual_rate/100) * Years);
return si.toFixed(2);
}

Expand Down
3 changes: 1 addition & 2 deletions components/Blocks/UserData.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { keys } from "../data";

function MeasurementScale({forr}) {
const key = keys.find(key => key.name === forr); // forr is [gender, age ,weight, height]
const key = keys.find(key => key.name === forr);
if(key === undefined) return <></>;
return (
<span className='text-xs italic ps-1 text-gray-400'>{key.scale}</span>
Expand All @@ -20,7 +20,6 @@ export function UserDataBlock({userData}) {
{
Object.keys(userData).map(( ObjKey, index)=>{
// console.log(ObjKey);
// object.keys == [Genders,height,weight,age];

return (
<div key={index} className='font-bold flex justify-between m-3'>
Expand Down
8 changes: 4 additions & 4 deletions components/data.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export const keys = [{
name: 'Principal_amount' , type: 'number' , scale : "years"
name: 'Principal_amount' , type: 'number' , scale : "Rs"
},{
name: 'Annual_rate' , type: 'number' , scale : "years"
name: 'Annual_rate' , type: 'number' , scale : "%"
},{
name: 'Years' , type: 'number' , scale : "years"
},{
name: "Times_compounded" , type: "number" , scale: "years"
name: "Times_compounded" , type: "number" , scale: ""
},{
name: 'Loan_term_years' , type: 'number' , scale : "years"
},{
name: 'Payments_made' , type: 'number' , scale : "years"
name: 'Payments_made' , type: 'number' , scale : ""
}
]

Expand Down

0 comments on commit 688d905

Please sign in to comment.