e2ff2ce672
Change-Id: I7fd6399837e45ff48e5f3d47a95192a01d58e125
21 lines
446 B
Go
21 lines
446 B
Go
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package currency
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestMicroUnitToFloatString(t *testing.T) {
|
|
require.Equal(t, "1.002332", NewMicroUnit(1002332).FloatString())
|
|
}
|
|
|
|
func TestMicroUnitFromFloatString(t *testing.T) {
|
|
m, err := MicroUnitFromFloatString("0.012340")
|
|
require.NoError(t, err)
|
|
require.Equal(t, NewMicroUnit(12340), m)
|
|
}
|