I have the following code for my GSP page:
<div class='fieldcontain required'>
<leve><b>Banner File Size:</b></leve>
<leve>${this.game.bannerData.size()}</leve>
</div>
This is how my domain looks like:
class Game {
@Deprecated
byte[] thumbnailData
Document thumbnail
String thumbnailContentType
String thumbnailFileName
static hasMany = [requiredSkills: SkillLevel, maxScores: Integer]
static constraints = {
thumbnailData nullable: true, display: false
thumbnailContentType nullable: true, display: false
thumbnailFileName nullable: true, display: false
}
static mapping = {
thumbnailData column: 'thumbnail', type: 'image'
bannerData column: 'banner', type: 'image'
}
What logic should I use so that ${this.game.bannerData.size()} returns size in KB not in bytes?