Money

Contents

General
CloudAssessSpec
CollegePreferenceService
CsvBuilder
DocumentService
DocumentSpec
EmailSpec
ExportSpec
MailchimpSpec
Mask
Money
Preferences
QualityResultSpec
ReportSpec
SmsSpec
SystemUserService
Database objects
ACLAccessKey
ACLRole
Account
AccountTransaction
Application
Article
ArticleProduct
Assessment
AssessmentClass
AssessmentSubmission
AttachmentData
Attendance
Banking
Certificate
ClassCost
ConcessionType
Contact
ContactRelation
ContactRelationType
CorporatePass
CorporatePassCourseClass
CorporatePassProduct
Country
Course
CourseClass
CourseClassTutor
CourseModule
CustomField
CustomFieldType
DefinedTutorRole
Discount
DiscountConcessionType
DiscountCourseClass
DiscountMembership
DiscountMembershipRelationType
Document
DocumentVersion
EmailTemplate
Enrolment
EntityRelation
ExportTemplate
Field
FieldConfiguration
FieldConfigurationScheme
FieldHeading
FundingSource
FundingUpload
FundingUploadOutcome
Import
Invoice
InvoiceDueDate
InvoiceLine
InvoiceLineDiscount
Language
Membership
MembershipProduct
Message
MessagePerson
Module
Note
Outcome
PayLine
PayRate
PaymentIn
PaymentInLine
PaymentMethod
PaymentOut
PaymentOutLine
Payslip
Preference
PriorLearning
Product
ProductItem
Qualification
Report
ReportOverlay
Room
SavedFind
Script
Session
SessionModule
Site
Student
StudentConcession
Survey
SystemUser
Tag
TagRelation
TagRequirement
Tax
TrainingPackage
Tutor
TutorAttendance
UnavailableRule
Voucher
VoucherPaymentIn
VoucherProduct
WaitingList
Enumerations
AccountTransactionType
AccountType
ApplicationStatus
AttachmentInfoVisibility
AttachmentSpecialType
AttendanceType
AvetmissStudentDisabilityType
AvetmissStudentEnglishProficiency
AvetmissStudentIndigenousStatus
AvetmissStudentLabourStatus
AvetmissStudentPriorEducation
AvetmissStudentSchoolLevel
ClassCostFlowType
ClassCostRepetitionType
ClassFundingSource
ClientIndustryEmploymentType
ClientOccupationIdentifierType
ConfirmationStatus
ContactDuplicateStatus
CourseClassAttendanceType
CourseEnrolmentType
CreditCardType
CreditLevel
CreditProviderType
CreditType
DeliveryMode
DeliverySchedule
DiscountType
EnrolmentStatus
EnrolmentVETFeeHelpStatus
EntityRelationType
ExpiryType
FieldConfigurationType
InvoiceType
KeyCode
KeyCollision
MessageStatus
MessageType
MoneyRounding
NodeSpecialType
OutcomeStatus
PaymentSource
PaymentStatus
PaymentType
PayslipStatus
PostcodeType
ProductStatus
ProductType
QualificationType
RecognitionOfPriorLearningIndicator
StudentCitizenship
StudentStatusForUnitOfStudy
StudyReason
SurveyTypeSource
SurveyVisibility
TriggerType
UsiStatus
VETFeeExemptionType
VoucherPaymentStatus

Money is a class which handles all the common features needed for handling currency. Most importantly, this class properly handles rounding at all times.

 
        public 
        Money
     {
  Money(org.codehaus.groovy.tools.groovydoc.ExternalGroovyClassDoc@473e3665  val);
  Money(null  dollars,
        null  cents);

}

Constructors

Money(val)

Construct a new money instance. If null or empty string is passed, then a Money.ZERO amount will be created.

String val

value to create

Money(dollars, cents)

Construct a new money instance, first argument is dollars, second is cents

int dollars

dollars value

int cents

cents value

Instance methods

add(val)

returns sum

Money val

to be added to this money object

Returns Money

new money object

add(val)

returns sum

BigDecimal val

to be added to this money object

Returns Money

new money object

divide(val)

returns quotient, where object is dividend and the param is divisor

Money val

divisor

Returns Money

new money object

divide(val)

returns quotient, where object is dividend and the param is divisor

BigDecimal val

divisor

Returns Money

new money object

divide(val, roundingUp)

returns quotient, where object is dividend and the param is divisor Used for rounding any value with cents to a greater integer value

BigDecimal val

divisor

boolean roundingUp

rounded up to the nearest dollar

Returns Money

new money object

divide(val, roundingUp)

returns quotient, where object is dividend and the param is divisor Used for rounding any value with cents to a greater integer value

Money val

divisor

boolean roundingUp

rounded up to the nearest dollar

Returns Money

new money object

multiply(val)

returns product

long val

factor

Returns Money

new money object

multiply(val)

returns product

BigDecimal val

factor

Returns Money

new money object

subtract(val)

returns difference, where object is minuend and param is subtrahend

Money val

subtrahend

Returns Money

new money object

subtract(val)

returns difference, where object is minuend and param is subtrahend

BigDecimal val

subtrahend

Returns Money

new money object

toBigDecimal()

Returns BigDecimal

a big decimal representation

toPlainString()

$25 -> "25.00"

Returns String

a string representation skipping currency sign