# trim_digits2_02b
# "trim" the front numbers and only see the last x numbers
# ex, this number, 12345678.90 , will be changed to 78.90
script trim1 {
# trim the digits left of the decimal point, down to x digits
input x = 0;
input digits = 2;
# move decimal point left 2
def dig = Power(10, digits);
def x2 = x / dig;
# remove integer portion
def x3 = x2 - Floor(x2);
# shift digits, move decimal point
plot z = x3 * dig;
}
# test numbers
#def x1 = 12345678.92;
#def x2 = 12345644.55;
#def x3 = 12345633.77;
#def x4 = 12345611.66;
def x1 = open;
def x2 = high;
def x3 = low;
def x4 = close;
input trim_digits = 2;
def x1_trim = trim1(x1, trim_digits);
def x2_trim = trim1(x2, trim_digits);
def x3_trim = trim1(x3, trim_digits);
def x4_trim = trim1(x4, trim_digits);
AddLabel(1, x1, Color.YELLOW);
AddLabel(1, x1_trim, Color.YELLOW);
AddLabel(1, " ", Color.black);
AddLabel(1, x2, Color.YELLOW);
AddLabel(1, x2_trim, Color.YELLOW);
AddLabel(1, " ", Color.black);
AddLabel(1, x3, Color.YELLOW);
AddLabel(1, x3_trim, Color.YELLOW);
AddLabel(1, " ", Color.black);
AddLabel(1, x4, Color.YELLOW);
AddLabel(1, x4_trim, Color.YELLOW);
#