equal
deleted
inserted
replaced
390 initForNumberOrNil |
390 initForNumberOrNil |
391 "initialize to convert to/from a number |
391 "initialize to convert to/from a number |
392 - if the string is empty or invalid, convert to nil" |
392 - if the string is empty or invalid, convert to nil" |
393 |
393 |
394 valueToStringBlock := [:num | |
394 valueToStringBlock := [:num | |
395 num isNil ifTrue:[''] |
395 num isNil ifTrue:[''] |
396 ifFalse:[num printString]]. |
396 ifFalse:[num printString]]. |
397 stringToValueBlock := [:string | |
397 stringToValueBlock := [:string | |
398 Number readFromString:string onError:nil] |
398 |s| |
|
399 |
|
400 s := string. |
|
401 (s endsWith:'.') ifTrue:[ |
|
402 s := s , '0' |
|
403 ]. |
|
404 Number readFromString:s onError:nil |
|
405 ] |
|
406 |
|
407 |
|
408 |
|
409 |
399 ! |
410 ! |
400 |
411 |
401 initForString |
412 initForString |
402 "initialize for a string - this is trivial" |
413 "initialize for a string - this is trivial" |
403 |
414 |
428 ! ! |
439 ! ! |
429 |
440 |
430 !PrintConverter class methodsFor:'documentation'! |
441 !PrintConverter class methodsFor:'documentation'! |
431 |
442 |
432 version |
443 version |
433 ^ '$Header: /cvs/stx/stx/libview2/PrintConverter.st,v 1.15 1997-02-11 10:54:23 ca Exp $' |
444 ^ '$Header: /cvs/stx/stx/libview2/PrintConverter.st,v 1.16 1997-02-11 19:08:41 ca Exp $' |
434 ! ! |
445 ! ! |