I have another variable called marketcap this is listed as say 100.50m and sometimes it is 1.5bn as seen below. I would like to convert this into numbers. I have done this using the following code in the spirit of having a go and section 9-12 of the FAQ.
560.49m |
3.60bn |
993.38m |
11.74bn |
Code:
generate marketcapm = subinstr(marketcap, "m", "", .) generate maketcapm2 = marketcapm*1000 generate marketcapbn = subinstr(marketcap, "bn", "", .) generate marketcapbn2 = marketcapbn*1000000 generate marketcap1 = marketcapm + marketcapbn
Comment