mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-13 08:47:17 +03:00
[examples] Update constant and comments.
This commit is contained in:
parent
01c158e1ae
commit
9deaa52aa6
@ -2,10 +2,10 @@
|
||||
function main(capital: u32, public rate: u32, periods: u8) -> u32 {
|
||||
console.assert(periods < 50u8);
|
||||
let amount: u32 = capital;
|
||||
for i:u8 in 0u8..10u8 { // accrue for 10 periods
|
||||
for i:u8 in 0u8..50u8 { // accrue for max 50 periods
|
||||
if i < periods {
|
||||
amount += amount * rate / 100u32; // round down
|
||||
}
|
||||
} // skip remaining periods
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user