From: Joseph Alotta
Sent: Friday, July 01, 2016 2:59 PM



Thanks, Ron.  I needed to preserve the negative, so I append a minus sign,
then use your snippet. 



[Ron Teitelbaum] Excellent!  Well done!

,

str := '($1,925.46)' . 
('(*)' match: str ) ifTrue: [str := '-', str]. 
str := str reject:  [:e | '($,)' includes: e]. 
num := str asNumber  => -1925.46 

Sincerely, 

Joe. 




 

_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to