strconv: minor cleanup in f64_to_str_lnd1() (#13804)
							parent
							
								
									0337882240
								
							
						
					
					
						commit
						e3dca82f9c
					
				|  | @ -158,31 +158,38 @@ pub fn f64_to_str_lnd1(f f64, dec_digit int) string { | |||
| 
 | ||||
| 		// get sign and decimal parts
 | ||||
| 		for c in s { | ||||
| 			if c == `-` { | ||||
| 			match c { | ||||
| 				`-` { | ||||
| 					sgn = -1 | ||||
| 					i++ | ||||
| 			} else if c == `+` { | ||||
| 				} | ||||
| 				`+` { | ||||
| 					sgn = 1 | ||||
| 					i++ | ||||
| 			} else if c >= `0` && c <= `9` { | ||||
| 				} | ||||
| 				`0`...`9` { | ||||
| 					b[i1] = c | ||||
| 					i1++ | ||||
| 					i++ | ||||
| 			} else if c == `.` { | ||||
| 				} | ||||
| 				`.` { | ||||
| 					if sgn > 0 { | ||||
| 						d_pos = i | ||||
| 					} else { | ||||
| 						d_pos = i - 1 | ||||
| 					} | ||||
| 					i++ | ||||
| 			} else if c == `e` { | ||||
| 				} | ||||
| 				`e` { | ||||
| 					i++ | ||||
| 					break | ||||
| 			} else { | ||||
| 				} | ||||
| 				else { | ||||
| 					s.free() | ||||
| 					return '[Float conversion error!!]' | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		b[i1] = 0 | ||||
| 
 | ||||
| 		// get exponent
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue