محل منفی در Edit راست به چپ!! (مثل -16)
سلام دوستان
یه مشکل کوچیک هست که همه همیشه از کنارش گذشتیم اونم اینکه وقتی یه Edit رو راست به چپ می کنیم و کاربر عدد منفی رو وارد می کنه منفی سمت راست عدد نشون داده میشه مثلا -16. البته توی محاسبات هیچ مشکلی نیست. اما توی نمایش یکم ضایع هستش. همه جا مثلا توی DBGrid و چاپ فست ریپورت و .. هم همینطور نشون داده میشه. کسی راه حل ساده براش سراغ داره؟
تشکر
نقل قول: محل منفی در Edit راست به چپ!! (مثل -16)
سلام
من از یک تابع استفاده می کنم.
function negative
(N:real):string;
begin
if N<0 then
Result:=Format('%2.0n-', [N * -1])
else
Result := Format('%2.0n', [N])
end;
و در GetText فیلد مقدار دهی می کنم
Text:=Negative(Qry1.FieldByName('Mande').Value);