storj/private/currency/microunit_test.go
Jeff Wendling e2ff2ce672 satellite: compensation package and commands
Change-Id: I7fd6399837e45ff48e5f3d47a95192a01d58e125
2020-03-30 14:08:14 -06:00

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)
}