我需要在我的 SAS 程序中编写一个PROC FORMAT
andPROC FCMP
来将马力值转换为瓦特。瓦特应具有以下格式:XXXXX,XX Watt.
proc fcmp outlib=work.functions.fun;
function hptow(c) $;
n = cats(c*745.7, ' Watts');
return (n);
endsub;
run;
options cmplib=work.functions;
proc format;
value hptow other=[hptow()];
run;
data my_cars;
set sashelp.cars;
format horsepower hptow.;
run;
但结果看起来像这样:
197610.
201339W
如何更改此错误并需要格式化列的输出格式?