If you want to get a file size of the CMS.File document type, you need to implement a transformation function with one parameter (FileAttachment) and return AttachmentSize property instead:
AttachmentInfo ai = AttachmentInfoProvider.GetAttachmentInfo(ValidationHelper.GetGuid(<FileAttachment>, Guid.Empty), CMSContext.CurrentSiteName);
return ai.AttachmentSize.ToString();