mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
add decimal subpackage ref
This commit is contained in:
@@ -501,7 +501,7 @@ Example:
|
|||||||
|
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
import "core:strconv"
|
import "core:strconv"
|
||||||
strconv_round_down_example :: proc() {
|
round_down_example :: proc() {
|
||||||
d: decimal.Decimal
|
d: decimal.Decimal
|
||||||
str := [64]u8{}
|
str := [64]u8{}
|
||||||
ok := decimal.set(&d, "123.456")
|
ok := decimal.set(&d, "123.456")
|
||||||
@@ -532,8 +532,8 @@ WARNING: There are no guarantees about overflow.
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
import "core:strconv"
|
import "core:strconv/decimal"
|
||||||
strconv_rounded_integer_example :: proc() {
|
rounded_integer_example :: proc() {
|
||||||
d: decimal.Decimal
|
d: decimal.Decimal
|
||||||
ok := decimal.set(&d, "123.456")
|
ok := decimal.set(&d, "123.456")
|
||||||
fmt.println(decimal.rounded_integer(&d))
|
fmt.println(decimal.rounded_integer(&d))
|
||||||
|
|||||||
Reference in New Issue
Block a user