ソースコード
public static class FloatExt { public static float GetAfterDecimalPoint( this float self ) { return self % 1; } }
使い方
Debug.Log( 1f.GetAfterDecimalPoint() ); // 1 Debug.Log( 1.23f.GetAfterDecimalPoint() ); // 0.23
public static class FloatExt { public static float GetAfterDecimalPoint( this float self ) { return self % 1; } }
Debug.Log( 1f.GetAfterDecimalPoint() ); // 1 Debug.Log( 1.23f.GetAfterDecimalPoint() ); // 0.23