auto p1 = Fixed!4("1.1"); assert(p1.value == 11_000); auto p2 = Fixed!4("1."); assert(p2.value == 10_000); auto p3 = Fixed!4("0"); assert(p3.value == 0); auto p4 = Fixed!4(""); assert(p4.value == 0); auto p5 = Fixed!3("1.2345", true); assert(p5.value == 1235);
Create a new Fixed struct given a string. If round is true, then the number is rounded to the nearest signficiant digit.