Skip to content

Commit

Permalink
link to luau library instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Mar 16, 2023
1 parent 87cc57d commit bbc8a60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ amount_table_with_salestax[_IDX] = amount_with_salestax;
running_total = running_total + Amount;
running_total_after_tax = running_total_after_tax + amount_with_salestax;
-- we round using Lua's powerful String library - https://www.lua.org/manual/5.4/manual.html#6.4
-- we round using Lua's powerful String library - https://luau-lang.org/library#string-library
running_total = string.format("%.2f", running_total);
local rounded_running_total_after_tax = string.format("%.2f", running_total_after_tax);
Expand All @@ -104,8 +104,8 @@ END {
-- and this is the END block, which is executed ONCE at the end
-- first we use Lua's table library to unpack the contents of the amount_table into a list
-- https://www.lua.org/manual/5.4/manual.html#6.6
-- and then we use the builtin math library - https://www.lua.org/manual/5.4/manual.html#6.7
-- https://luau-lang.org/library#table-library
-- and then we use the builtin math library - https://luau-lang.org/library#math-library
-- to get the min and max values
local min_amount: number = math.min(table.unpack(amount_table_with_salestax));
local max_amount: number = math.max(table.unpack(amount_table_with_salestax));
Expand Down
6 changes: 3 additions & 3 deletions examples/readme-example/testlookup.luau
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ amount_table_with_salestax[_IDX] = amount_with_salestax;
running_total = running_total + Amount;
running_total_after_tax = running_total_after_tax + amount_with_salestax;

-- we round using Lua's powerful String library - https://www.lua.org/manual/5.4/manual.html#6.4
-- we round using Lua's powerful String library - https://luau-lang.org/library#string-library
running_total = string.format("%.2f", running_total);
local rounded_running_total_after_tax = string.format("%.2f", running_total_after_tax);

Expand All @@ -59,8 +59,8 @@ END {
-- and this is the END block, which is executed ONCE at the end

-- first we use Lua's table library to unpack the contents of the amount_table into a list
-- https://www.lua.org/manual/5.4/manual.html#6.6
-- and then we use the builtin math library - https://www.lua.org/manual/5.4/manual.html#6.7
-- https://luau-lang.org/library#table-library
-- and then we use the builtin math library - https://luau-lang.org/library#math-library
-- to get the min and max values
local min_amount: number = math.min(table.unpack(amount_table_with_salestax));
local max_amount: number = math.max(table.unpack(amount_table_with_salestax));
Expand Down

0 comments on commit bbc8a60

Please sign in to comment.